From 544ec1d465543f0c9046124dbd6d95f837018df8 Mon Sep 17 00:00:00 2001 From: Klaus Goger Date: Mon, 8 Jan 2018 08:38:07 +0100 Subject: [PATCH] Fix pack parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The index needѕ to be incremented after a valid path was found. Otherwise gOpts.loader[index].name will be out of of bound after the second iteration. Signed-off-by: Klaus Goger --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index fea5b7f..4515c75 100644 --- a/main.cpp +++ b/main.cpp @@ -1073,9 +1073,9 @@ static bool parseLoader(FILE* file) { if (fscanf(file, OPT_LOADER_NAME "%d=%s", &index, buf) != 2) return false; - index--; strcpy(gOpts.loader[index].name, buf); printf("name%d: %s\n", index, gOpts.loader[index].name); + index++; } for (i=0; i