From b142354d746ad543dc64332d5136ad90330e2cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Fri, 29 May 2020 20:47:03 +0800 Subject: [PATCH] parserLoader: Fix loader name index in LOADER_OPTION. As show in the config.ini, the loader name should start with 1, not 0. Before `rkdeveloptool pack' worked with: [LOADER_OPTION] NUM=2 LOADER0=FOO LOADER1=BAR Now it works with: [LOADER_OPTION] NUM=2 LOADER1=FOO LOADER2=BAR --- main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index a9a88bb..3685a5b 100644 --- a/main.cpp +++ b/main.cpp @@ -1194,8 +1194,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); + printf("name%d: %s\n", index+1, gOpts.loader[index].name); index++; } for (i=0; i