From 040ca1cfb5a3e1be7d05bcd90eaa4f01fb68437a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 29 Mar 2014 21:23:29 -0400 Subject: doom: Eliminate use of unsafe string functions. Eliminate use of strcpy, strcat, strncpy, and use the new safe alternatives. --- src/doom/wi_stuff.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/doom/wi_stuff.c') 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 -- cgit v1.2.3