summaryrefslogtreecommitdiff
path: root/src/setup/multiplayer.c
diff options
context:
space:
mode:
authorSimon Howard2014-04-01 20:56:33 -0400
committerSimon Howard2014-04-01 20:56:33 -0400
commit17c14e1fad6dc277a6e58e4f421d5c65e210d1fe (patch)
treefab7248ca23ce615c62222377a3ff5cab6bbeb73 /src/setup/multiplayer.c
parent8eb3200286d523379295143ce3f44d77ce036d4b (diff)
downloadchocolate-doom-17c14e1fad6dc277a6e58e4f421d5c65e210d1fe.tar.gz
chocolate-doom-17c14e1fad6dc277a6e58e4f421d5c65e210d1fe.tar.bz2
chocolate-doom-17c14e1fad6dc277a6e58e4f421d5c65e210d1fe.zip
setup: Eliminate use of sprintf().
Use M_snprintf() or M_StringJoin() instead where appropriate. This fixes #371.
Diffstat (limited to 'src/setup/multiplayer.c')
-rw-r--r--src/setup/multiplayer.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/setup/multiplayer.c b/src/setup/multiplayer.c
index d9fa3f4e..b151a10d 100644
--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -308,11 +308,11 @@ static void UpdateWarpButton(void)
if (warptype == WARP_ExMy)
{
- sprintf(buf, "E%iM%i", warpepisode, warpmap);
+ M_snprintf(buf, sizeof(buf), "E%iM%i", warpepisode, warpmap);
}
else if (warptype == WARP_MAPxy)
{
- sprintf(buf, "MAP%02i", warpmap);
+ M_snprintf(buf, sizeof(buf), "MAP%02i", warpmap);
}
TXT_SetButtonLabel(warpbutton, buf);
@@ -425,7 +425,7 @@ static void LevelSelectDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))
continue;
}
- sprintf(buf, " E%iM%i ", x, y);
+ M_snprintf(buf, sizeof(buf), " E%iM%i ", x, y);
button = TXT_NewButton(buf);
TXT_SignalConnect(button, "pressed",
SetExMyWarp, (void *) (x * 10 + y));
@@ -457,7 +457,7 @@ static void LevelSelectDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))
continue;
}
- sprintf(buf, " MAP%02i ", l);
+ M_snprintf(buf, sizeof(buf), " MAP%02i ", l);
button = TXT_NewButton(buf);
TXT_SignalConnect(button, "pressed",
SetMAPxyWarp, (void *) l);
@@ -898,7 +898,7 @@ static void QueryResponseCallback(net_addr_t *addr,
char ping_time_str[16];
char description[47];
- sprintf(ping_time_str, "%ims", ping_time);
+ M_snprintf(ping_time_str, sizeof(ping_time_str), "%ims", ping_time);
M_StringCopy(description, querydata->description,
sizeof(description));
@@ -1094,7 +1094,7 @@ void MultiplayerConfig(void)
for (i=0; i<10; ++i)
{
- sprintf(buf, "#%i ", i + 1);
+ M_snprintf(buf, sizeof(buf), "#%i ", i + 1);
label = TXT_NewLabel(buf);
TXT_SetFGColor(label, TXT_COLOR_BRIGHT_CYAN);
@@ -1119,7 +1119,7 @@ void BindMultiplayerVariables(void)
for (i=0; i<10; ++i)
{
- sprintf(buf, "chatmacro%i", i);
+ M_snprintf(buf, sizeof(buf), "chatmacro%i", i);
M_BindVariable(buf, &chat_macros[i]);
}