shithub: choc

Download patch

ref: 52c49e45fb8da3dc0fa7c9d26d34c39b4a7cbc71
parent: af804990166f96c87bbd9fb317251f5fe79de56b
author: mfrancis95 <[email protected]>
date: Mon Dec 31 22:18:03 EST 2018

Apply @fabiangreffrath's patch to fix a memory error in Hexen

--- a/src/hexen/sc_man.c
+++ b/src/hexen/sc_man.c
@@ -197,15 +197,15 @@
     {
         while (*ScriptPtr <= 32)
         {
-            if (ScriptPtr >= ScriptEndPtr)
-            {
-                sc_End = true;
-                return false;
-            }
             if (*ScriptPtr++ == '\n')
             {
                 sc_Line++;
                 sc_Crossed = true;
+            }
+            if (ScriptPtr >= ScriptEndPtr)
+            {
+                sc_End = true;
+                return false;
             }
         }
         if (ScriptPtr >= ScriptEndPtr)