From: Alexander Couzens Date: Thu, 15 Mar 2018 17:17:01 +0000 (+0100) Subject: firmware-utils: tplink-safeloader: compile as gnu99 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3137622efb8af483ae098c3fb5ddef219c5cde46;p=openwrt%2Fstaging%2Fneocturne.git firmware-utils: tplink-safeloader: compile as gnu99 Also fix minor coding style issue and one redeclaration. Signed-off-by: Alexander Couzens --- diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index ca41387b5e..f3fefa329a 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -42,7 +42,7 @@ define Host/Compile $(call cc,mkplanexfw sha1) $(call cc,mktplinkfw mktplinkfw-lib md5, -Wall -fgnu89-inline) $(call cc,mktplinkfw2 mktplinkfw-lib md5, -fgnu89-inline) - $(call cc,tplink-safeloader md5, -Wall) + $(call cc,tplink-safeloader md5, -Wall --std=gnu99) $(call cc,pc1crypt) $(call cc,osbridge-crc) $(call cc,wrt400n cyg_crc32) diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 3c979f7f86..eb99241136 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1417,8 +1417,9 @@ static int add_flash_partition( unsigned long base, unsigned long size) { + int ptr; /* check if the list has a free entry */ - for (int ptr=0; ptrname == NULL && part_list->base == 0 && part_list->size == 0) @@ -1494,7 +1495,7 @@ static int read_partition_table( break; } - for (int i=0; i<=4; i++) { + for (int i = 0; i <= 4; i++) { if (end_part <= ptr) break; @@ -1620,7 +1621,7 @@ static int extract_firmware(const char *input, const char *output_directory) error(1, 0, "Error can not read the partition table (fwup-ptn)"); } - for (int i=0; iname, name) == 0) return entries; }