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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Missing braces
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 31 Jul 2020 10:47:22 +0200

Download raw body.

Thread
  • Christian Weisgerber:

    Missing braces

    • Tracey Emery:

      Missing braces

    • Stefan Sperling:

      Missing braces

On Thu, Jul 30, 2020 at 10:34:30PM +0200, Christian Weisgerber wrote:
> 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?

Yes, thanks!

> 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
> 
>