From bc873169f115dc15c1598a42d3169d6b5f5eb149 Mon Sep 17 00:00:00 2001 From: ehouse Date: Mon, 10 Mar 2008 12:02:53 +0000 Subject: [PATCH] Add __attribute__ ((format)) and fix problem it flags. --- xwords4/linux/linuxudp.c | 4 ++-- xwords4/linux/xptypes.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xwords4/linux/linuxudp.c b/xwords4/linux/linuxudp.c index f108a1067..399b6ec06 100644 --- a/xwords4/linux/linuxudp.c +++ b/xwords4/linux/linuxudp.c @@ -248,8 +248,8 @@ linux_udp_send( const XP_U8* buf, XP_U16 buflen, const CommsAddrRec* addrp, } if ( haveAddress ) { - XP_LOGF( "calling sendto: sock=%d; port=%d; ipaddr=%lx", stuff->socket, - ntohs(to.sin_port), to.sin_addr.s_addr ); + XP_LOGF( "calling sendto: sock=%d; port=%d; ipaddr=%x", + stuff->socket, ntohs(to.sin_port), to.sin_addr.s_addr ); nSent = sendto( stuff->socket, buf, buflen, 0, (struct sockaddr*)&to, sizeof(to) ); if ( nSent != buflen ) { diff --git a/xwords4/linux/xptypes.h b/xwords4/linux/xptypes.h index c8397a0a3..33aa4602c 100644 --- a/xwords4/linux/xptypes.h +++ b/xwords4/linux/xptypes.h @@ -61,7 +61,8 @@ typedef unsigned long XP_Time; #define XP_LOGF XP_DEBUGF #ifdef DEBUG -extern void linux_debugf(char*, ...); +extern void linux_debugf(const char*, ...) + __attribute__ ((format (printf, 1, 2))); #define XP_DEBUGF(...) linux_debugf(__VA_ARGS__) #else