diff options
author | Simon Howard | 2014-03-30 18:21:42 -0400 |
---|---|---|
committer | Simon Howard | 2014-03-30 18:21:42 -0400 |
commit | 4465be140a27e47aa8bed15be4e58064297c7d94 (patch) | |
tree | f27954337910f277d7883feab70e6b2a1fc421b6 /src/doom/d_main.c | |
parent | e56c9c948df1ad0e2ff2b64d8593caefbf98fd11 (diff) | |
download | chocolate-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.c | 5 |
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])) { |