Skip to content

Commit

Permalink
fix an FTBFS with -Werror=format-security
Browse files Browse the repository at this point in the history
Fixes ticket:3493.
  • Loading branch information
pabs3 authored and Cyp committed May 20, 2012
1 parent 52511ce commit e5d2242
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/netplay/netplay.cpp
Expand Up @@ -2505,7 +2505,7 @@ static void NETallowJoining(void)

char buf[250] = {'\0'};
snprintf(buf, sizeof(buf), "Player %s has joined, IP is: %s", name, NetPlay.players[index].IPtextAddress);
debug(LOG_INFO, buf);
debug(LOG_INFO, "%s", buf);
NETlogEntry(buf, SYNC_FLAG, index);

debug(LOG_NET, "Player, %s, with index of %u has joined using socket %p", name, (unsigned int)index, connected_bsocket[index]);
Expand Down Expand Up @@ -3177,7 +3177,7 @@ struct SyncDebugIntList : public SyncDebugEntry
{
switch (numInts)
{
case 0: index += snprintf(buf + index, bufSize - index, string); break;
case 0: index += snprintf(buf + index, bufSize - index, "%s", string); break;
case 1: index += snprintf(buf + index, bufSize - index, string, ints[0]); break;
case 2: index += snprintf(buf + index, bufSize - index, string, ints[0], ints[1]); break;
case 3: index += snprintf(buf + index, bufSize - index, string, ints[0], ints[1], ints[2]); break;
Expand Down
2 changes: 1 addition & 1 deletion lib/script/parse.h
Expand Up @@ -305,7 +305,7 @@ extern bool scriptInitParser(void);
extern int scr_parse(void);

/* Give an error message */
void scr_error(const char *pMessage, ...) WZ_DECL_FORMAT(printf, 1, 2);
void scr_error(const char *pMessage, ...);

extern void scriptGetErrorData(int *pLine, char **ppText);

Expand Down
2 changes: 1 addition & 1 deletion src/qtscriptfuncs.cpp
Expand Up @@ -1133,7 +1133,7 @@ static QScriptValue js_debug(QScriptContext *context, QScriptEngine *engine)
}
result.append(s);
}
qWarning(result.toAscii().constData());
qWarning("%s", result.toAscii().constData());
return QScriptValue();
}

Expand Down
2 changes: 1 addition & 1 deletion src/scriptvals.h
Expand Up @@ -56,7 +56,7 @@ struct ARRAY_INDEXES

/* A simple error reporting routine */

extern void scrv_error(const char* fmt, ...) WZ_DECL_FORMAT(printf, 1, 2);
extern void scrv_error(const char* fmt, ...);

// Lookup a type
extern bool scrvLookUpType(const char *pIdent, INTERP_TYPE *pType);
Expand Down

0 comments on commit e5d2242

Please sign in to comment.