"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Missing braces
To:
gameoftrees@openbsd.org
Date:
Thu, 30 Jul 2020 22:34:30 +0200

Download raw body.

Thread
  • Christian Weisgerber:

    Missing braces

clang 10 says:

/home/naddy/got/libexec/got-fetch-pack/got-fetch-pack.c:320:4: error: misleading indentation; statement is not part of the previous 'for' [-Werror,-Wmisleading-indentation]
                        tokens[j] = NULL;
                        ^
/home/naddy/got/libexec/got-fetch-pack/got-fetch-pack.c:318:3: note: previous statement is here
                for (j = 0; j < i; j++)
                ^
1 error generated.

------------------------------------------------------------------------

Fix missing block grouping.

OK?

diff ff21961dc4dad7f7d30223f9b6fbe38fa9ca0b3c /home/naddy/got
blob - 8f12b8a31ccaad03d37aa324b719c8c96c8f50d1
file + libexec/got-fetch-pack/got-fetch-pack.c
--- libexec/got-fetch-pack/got-fetch-pack.c
+++ libexec/got-fetch-pack/got-fetch-pack.c
@@ -315,9 +315,10 @@ tokenize_refline(char **tokens, char *line, int len, i
 done:
 	if (err) {
 		int j;
-		for (j = 0; j < i; j++)
+		for (j = 0; j < i; j++) {
 			free(tokens[j]);
 			tokens[j] = NULL;
+		}
 	}
 	return err;
 }
-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de