From 5f9b4368a2adad65dcc960a76c45d12059ca7214 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 29 Mar 2014 21:24:03 -0400 Subject: heretic: Eliminate use of unsafe string functions. Eliminate use of strcpy, strcat, strncpy, and use the new safe alternatives. --- src/heretic/mn_menu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/heretic/mn_menu.c') diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c index 1c94b20b..3057261f 100644 --- a/src/heretic/mn_menu.c +++ b/src/heretic/mn_menu.c @@ -32,6 +32,7 @@ #include "i_system.h" #include "i_swap.h" #include "m_controls.h" +#include "m_misc.h" #include "p_local.h" #include "r_local.h" #include "s_sound.h" @@ -854,7 +855,7 @@ static boolean SCSaveGame(int option) if (!FileMenuKeySteal) { FileMenuKeySteal = true; - strcpy(oldSlotText, SlotText[option]); + M_StringCopy(oldSlotText, SlotText[option], sizeof(oldSlotText)); ptr = SlotText[option]; while (*ptr) { @@ -1513,7 +1514,8 @@ boolean MN_Responder(event_t * event) if (key == KEY_ESCAPE) { memset(SlotText[currentSlot], 0, SLOTTEXTLEN + 2); - strcpy(SlotText[currentSlot], oldSlotText); + M_StringCopy(SlotText[currentSlot], oldSlotText, + sizeof(SlotText[currentSlot])); SlotStatus[currentSlot]--; MN_DeactivateMenu(); return (true); -- cgit v1.2.3