diff options
-rw-r--r-- | Xtransint.h | 10 | ||||
-rw-r--r-- | Xtransutil.c | 11 |
2 files changed, 14 insertions, 7 deletions
diff --git a/Xtransint.h b/Xtransint.h index 523751e..8cc0b68 100644 --- a/Xtransint.h +++ b/Xtransint.h @@ -347,7 +347,7 @@ static int TRANS(WriteV)( static int is_numeric ( - char * /* str */ + const char * /* str */ ); #ifdef TRANS_SERVER @@ -372,7 +372,7 @@ static int trans_mkdir ( int hack= 0, saveerrno=errno; \ struct timeval tp;\ gettimeofday(&tp,0); \ - ErrorF(__xtransname); \ + ErrorF("%s",__xtransname); \ ErrorF(x+hack,a,b,c); \ ErrorF("timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ errno=saveerrno; \ @@ -382,7 +382,7 @@ static int trans_mkdir ( int hack= 0, saveerrno=errno; \ struct timeval tp;\ gettimeofday(&tp,0); \ - fprintf(stderr, __xtransname); fflush(stderr); \ + fprintf(stderr, "%s", __xtransname); fflush(stderr); \ fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \ fflush(stderr); \ @@ -394,14 +394,14 @@ static int trans_mkdir ( /* Use ErrorF() for the X server */ #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ int hack= 0, saveerrno=errno; \ - ErrorF(__xtransname); \ + ErrorF("%s",__xtransname); \ ErrorF(x+hack,a,b,c); \ errno=saveerrno; \ } else ((void)0) #else #define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \ int hack= 0, saveerrno=errno; \ - fprintf(stderr, __xtransname); fflush(stderr); \ + fprintf(stderr, "%s", __xtransname); fflush(stderr); \ fprintf(stderr, x+hack,a,b,c); fflush(stderr); \ errno=saveerrno; \ } else ((void)0) diff --git a/Xtransutil.c b/Xtransutil.c index 134446d..2ffcb0d 100644 --- a/Xtransutil.c +++ b/Xtransutil.c @@ -225,6 +225,13 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) #ifdef ICE_t +/* Needed for _XGethostbyaddr usage in TRANS(GetPeerNetworkId) */ +# if defined(TCPCONN) || defined(UNIXCONN) +# define X_INCLUDE_NETDB_H +# define XOS_USE_NO_LOCKING +# include <X11/Xos_r.h> +# endif + #include <signal.h> char * @@ -442,10 +449,10 @@ TRANS(WSAStartup) (void) } #endif +#include <ctype.h> static int -is_numeric (char *str) - +is_numeric (const char *str) { int i; |