Fix pack parsing

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 <klaus.goger@theobroma-systems.com>
This commit is contained in:
Klaus Goger 2018-01-08 08:38:07 +01:00
parent 5b7445d109
commit 544ec1d465

View File

@ -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<gOpts.loaderNum; i++) {
if (SCANF_EAT(file) != 0) {