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/r_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/heretic/r_data.c') diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c index a2f3f10e..34fcb225 100644 --- a/src/heretic/r_data.c +++ b/src/heretic/r_data.c @@ -29,6 +29,7 @@ #include "i_swap.h" #include "i_system.h" +#include "m_misc.h" #include "r_local.h" #include "p_local.h" @@ -325,14 +326,13 @@ void R_InitTextures(void) // // load the patch names from pnames.lmp // - name[8] = 0; names = W_CacheLumpName(pnames, PU_STATIC); nummappatches = LONG(*((int *) names)); name_p = names + 4; patchlookup = Z_Malloc(nummappatches * sizeof(*patchlookup), PU_STATIC, NULL); for (i = 0; i < nummappatches; i++) { - strncpy(name, name_p + i * 8, 8); + M_StringCopy(name, name_p + i * 8, sizeof(name)); patchlookup[i] = W_CheckNumForName(name); } W_ReleaseLumpName(pnames); -- cgit v1.2.3