From d8bee037073526ca4e1c3632edf77851e723323a Mon Sep 17 00:00:00 2001 From: NoiTaTuM Date: Wed, 11 Jan 2017 10:43:55 -0300 Subject: [PATCH] Fix segmentation fault in IsPatch. Change pointer to long in IsPatch to pointer to uint32_t. The size of long depends on the implementation, most posix systems are LP64, wich means long is 64 bits not 32 bits like in Windows. The program now seems to work on Linux with GCC. --- wadext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadext.cpp b/wadext.cpp index 1c9520d..91dd292 100644 --- a/wadext.cpp +++ b/wadext.cpp @@ -85,7 +85,7 @@ char * getdir(const char * lump) bool isPatch(const char * n) { if (!pstartfound || PNames.mLump < 0) return false; - long * l = (long*)PNames.Address(); + uint32_t * l = (uint32_t*)PNames.Address(); char * c = (char*)(l + 1); char nn[9];