summaryrefslogtreecommitdiff
path: root/src/doom/wi_stuff.c
diff options
context:
space:
mode:
authorSimon Howard2014-03-29 21:23:29 -0400
committerSimon Howard2014-03-29 21:23:29 -0400
commit040ca1cfb5a3e1be7d05bcd90eaa4f01fb68437a (patch)
treea18e508d59f858f2d4bfda860a299a8f271a080a /src/doom/wi_stuff.c
parente76b5678bfcac6fc7a42b2f581192ae08831728e (diff)
downloadchocolate-doom-040ca1cfb5a3e1be7d05bcd90eaa4f01fb68437a.tar.gz
chocolate-doom-040ca1cfb5a3e1be7d05bcd90eaa4f01fb68437a.tar.bz2
chocolate-doom-040ca1cfb5a3e1be7d05bcd90eaa4f01fb68437a.zip
doom: Eliminate use of unsafe string functions.
Eliminate use of strcpy, strcat, strncpy, and use the new safe alternatives.
Diffstat (limited to 'src/doom/wi_stuff.c')
-rw-r--r--src/doom/wi_stuff.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/doom/wi_stuff.c b/src/doom/wi_stuff.c
index 298dc07d..016226fe 100644
--- a/src/doom/wi_stuff.c
+++ b/src/doom/wi_stuff.c
@@ -29,6 +29,7 @@
#include "z_zone.h"
+#include "m_misc.h"
#include "m_random.h"
#include "deh_main.h"
@@ -1692,17 +1693,15 @@ static void WI_loadUnloadData(load_callback_t callback)
if (gamemode == commercial)
{
- strncpy(name, DEH_String("INTERPIC"), 9);
- name[8] = '\0';
+ M_StringCopy(name, DEH_String("INTERPIC"), sizeof(name));
}
else if (gamemode == retail && wbs->epsd == 3)
{
- strncpy(name, DEH_String("INTERPIC"), 9);
- name[8] = '\0';
+ M_StringCopy(name, DEH_String("INTERPIC"), sizeof(name));
}
else
{
- DEH_snprintf(name, 9, "WIMAP%d", wbs->epsd);
+ DEH_snprintf(name, sizeof(name), "WIMAP%d", wbs->epsd);
}
// Draw backdrop and save to a temporary buffer