Quash some compile-time warnings. snprintf instead of sprintf.

This commit is contained in:
ehouse 2008-12-06 15:59:30 +00:00
parent 03d12bacd3
commit 07e3b26e60
4 changed files with 8 additions and 2 deletions

View file

@ -526,7 +526,7 @@ setLimitsFrom( const BoardCtxt* board, BdHintLimits* limits )
#endif
static XP_Bool
scrollTimerProc( void* closure, XWTimerReason why )
scrollTimerProc( void* closure, XWTimerReason XP_UNUSED_DBG(why) )
{
XP_Bool draw = XP_FALSE;
BoardCtxt* board = (BoardCtxt*)closure;

View file

@ -143,6 +143,10 @@ game_reset( MPFORMAL XWGame* game, CurGameInfo* gi,
nPlayersHere, nPlayersTotal,
sendproc, IF_CH(resetproc) closure );
}
#else
# ifdef DEBUG
mpool = mpool; /* quash unused formal warning */
# endif
#endif
model_init( game->model, gi->boardSize, gi->boardSize );

View file

@ -17,6 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdio.h>
#include "cedebug.h"
#ifdef DEBUG
@ -120,7 +121,7 @@ logLastError( const char* comment )
XP_U16 len;
XP_U16 lenSoFar;
sprintf( msg, "%s (err: %ld): ", comment, lastErr );
snprintf( msg, sizeof(msg), "%s (err: %ld): ", comment, lastErr );
lenSoFar = strlen( msg );
FormatMessage(

View file

@ -21,6 +21,7 @@
#include <windowsx.h>
#include "stdafx.h"
#include <commdlg.h>
#include <wchar.h>
#ifdef _win32_wce
#include <aygshell.h>
#endif