mirror of
https://github.com/sharkcz/rkdeveloptool.git
synced 2025-02-13 22:36:47 +01:00
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:
parent
5b7445d109
commit
544ec1d465
2
main.cpp
2
main.cpp
@ -1073,9 +1073,9 @@ static bool parseLoader(FILE* file) {
|
|||||||
if (fscanf(file, OPT_LOADER_NAME "%d=%s", &index, buf)
|
if (fscanf(file, OPT_LOADER_NAME "%d=%s", &index, buf)
|
||||||
!= 2)
|
!= 2)
|
||||||
return false;
|
return false;
|
||||||
index--;
|
|
||||||
strcpy(gOpts.loader[index].name, buf);
|
strcpy(gOpts.loader[index].name, buf);
|
||||||
printf("name%d: %s\n", index, gOpts.loader[index].name);
|
printf("name%d: %s\n", index, gOpts.loader[index].name);
|
||||||
|
index++;
|
||||||
}
|
}
|
||||||
for (i=0; i<gOpts.loaderNum; i++) {
|
for (i=0; i<gOpts.loaderNum; i++) {
|
||||||
if (SCANF_EAT(file) != 0) {
|
if (SCANF_EAT(file) != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user