From c3bb2a9ecf439c10d4bb03b7ac09b0773832e257 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 22 Mar 2016 09:41:44 +0100 Subject: [PATCH] Prevent crash on loading empty game file The parser code is made resistant to loading a file with 0 characters in it. --- parser.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/parser.c b/parser.c index c2eda2b..e325005 100644 --- a/parser.c +++ b/parser.c @@ -404,7 +404,7 @@ NextUnit (char **p) if(**p == NULLCHAR) { // make sure there is something to parse if(fromString) return 0; // we are parsing string, so the end is really the end - *p = inPtr = inputBuf; + *p = inPtr = parseStart = inputBuf; if(!ReadLine()) return 0; // EOF } else if(inPtr > inputBuf + PARSEBUFSIZE/2) { // buffer fills up with already parsed stuff char *q = *p, *r = inputBuf; -- 1.7.0.4