summaryrefslogtreecommitdiff
path: root/src/doom/d_main.c
diff options
context:
space:
mode:
authorSimon Howard2014-03-30 18:21:42 -0400
committerSimon Howard2014-03-30 18:21:42 -0400
commit4465be140a27e47aa8bed15be4e58064297c7d94 (patch)
treef27954337910f277d7883feab70e6b2a1fc421b6 /src/doom/d_main.c
parente56c9c948df1ad0e2ff2b64d8593caefbf98fd11 (diff)
downloadchocolate-doom-4465be140a27e47aa8bed15be4e58064297c7d94.tar.gz
chocolate-doom-4465be140a27e47aa8bed15be4e58064297c7d94.tar.bz2
chocolate-doom-4465be140a27e47aa8bed15be4e58064297c7d94.zip
doom: Eliminate use of sprintf().
Use snprintf() or other functions in place of sprintf(). This is part of fixing #371.
Diffstat (limited to 'src/doom/d_main.c')
-rw-r--r--src/doom/d_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index 6d37e455..0cdb83d4 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -384,7 +384,7 @@ void D_BindVariables(void)
{
char buf[12];
- sprintf(buf, "chatmacro%i", i);
+ snprintf(buf, sizeof(buf), "chatmacro%i", i);
M_BindVariable(buf, &chat_macros[i]);
}
}
@@ -669,7 +669,8 @@ static char *GetGameName(char *gamename)
gamename_size = strlen(deh_sub) + 10;
gamename = Z_Malloc(gamename_size, PU_STATIC, 0);
version = G_VanillaVersionCode();
- sprintf(gamename, deh_sub, version / 100, version % 100);
+ snprintf(gamename, gamename_size, deh_sub,
+ version / 100, version % 100);
while (gamename[0] != '\0' && isspace(gamename[0]))
{