From a52a9ef0bc5b327bc0543a4f4c5d5ce7f330c402 Mon Sep 17 00:00:00 2001 From: surkeh Date: Mon, 9 Apr 2018 21:16:20 -0700 Subject: [PATCH] Check for texture pack done in memory --- test/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/main.c b/test/main.c index 472f1a4..1c70c73 100644 --- a/test/main.c +++ b/test/main.c @@ -71,13 +71,11 @@ bool unpackpld(const char *filedata, fn = (char*)malloc(strlen(filename) + 3 + 4); int size = 0; unsigned int i = 0; - char filetype[TYPE_ID_LENGTH]; - char filetypetexture[TYPE_ID_LENGTH] = {'\0', '2', '3', 'T'}; + char textureid[TYPE_ID_LENGTH] = {'\0', '2', '3', 'T'}; for (i = 0; i < h.numOffset; i++) { const char * currentfile = filedata + h.offsets[i]; size = sizeofpldstruct(&h, i, filesize); - memcpy(filetype, currentfile, TYPE_ID_LENGTH); - if (strcmp( filetype, filetypetexture ) == 0) + if (strncmp( currentfile, textureid, TYPE_ID_LENGTH ) == 0) sprintf(fn, "%s_%d.txp", filename, i); else sprintf(fn, "%s_%d", filename, i);