summaryrefslogtreecommitdiff
path: root/src/doom/r_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/doom/r_data.c')
-rw-r--r--src/doom/r_data.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/doom/r_data.c b/src/doom/r_data.c
index 13c9eb98..3d59a171 100644
--- a/src/doom/r_data.c
+++ b/src/doom/r_data.c
@@ -36,6 +36,7 @@
#include "w_wad.h"
#include "doomdef.h"
+#include "m_misc.h"
#include "r_local.h"
#include "p_local.h"
@@ -491,19 +492,19 @@ void R_InitTextures (void)
// Load the patch names from pnames.lmp.
- name[8] = 0;
+ name[8] = 0;
names = W_CacheLumpName (DEH_String("PNAMES"), PU_STATIC);
nummappatches = LONG ( *((int *)names) );
- name_p = names+4;
+ name_p = names + 4;
patchlookup = Z_Malloc(nummappatches*sizeof(*patchlookup), PU_STATIC, NULL);
-
- for (i=0 ; i<nummappatches ; i++)
+
+ for (i = 0; i < nummappatches; i++)
{
- strncpy (name,name_p+i*8, 8);
- patchlookup[i] = W_CheckNumForName (name);
+ M_StringCopy(name, name_p + i * 8, sizeof(name));
+ patchlookup[i] = W_CheckNumForName(name);
}
W_ReleaseLumpName(DEH_String("PNAMES"));
-
+
// Load the map texture definitions from textures.lmp.
// The data is contained in one or two lumps,
// TEXTURE1 for shareware, plus TEXTURE2 for commercial.