Re: [PATCH] rebase-interactive.c: silence format-zero-length warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ralf,

Le 27/02/2020 à 21:25, Ralf Thielow via GitGitGadget a écrit :
> From: Ralf Thielow <ralf.thielow@xxxxxxxxx>
> 
> Fixes the following warnings:
> 
> rebase-interactive.c: In function ‘edit_todo_list’:
> rebase-interactive.c:137:38: warning: zero-length gnu_printf format string [-Wformat-zero-length]
>     write_file(rebase_path_dropped(), "");
> rebase-interactive.c:144:37: warning: zero-length gnu_printf format string [-Wformat-zero-length]
>    write_file(rebase_path_dropped(), "");
> 
> Signed-off-by: Ralf Thielow <ralf.thielow@xxxxxxxxx>
> ---
>     rebase-interactive.c: silence format-zero-length warnings
>     
>     I noticed these warnings a while ago and they're still there, so here's
>     my fix.
> 
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-567%2Fralfth%2Fformat-zero-length-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-567/ralfth/format-zero-length-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/567
> 
>  rebase-interactive.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/rebase-interactive.c b/rebase-interactive.c
> index ac001dea588..0a4572e67ea 100644
> --- a/rebase-interactive.c
> +++ b/rebase-interactive.c
> @@ -134,14 +134,14 @@ int edit_todo_list(struct repository *r, struct todo_list *todo_list,
>  
>  	if (incorrect) {
>  		if (todo_list_check_against_backup(r, new_todo)) {
> -			write_file(rebase_path_dropped(), "");
> +			write_file(rebase_path_dropped(), "%s", "");
>  			return -4;
>  		}
>  
>  		if (incorrect > 0)
>  			unlink(rebase_path_dropped());
>  	} else if (todo_list_check(todo_list, new_todo)) {
> -		write_file(rebase_path_dropped(), "");
> +		write_file(rebase_path_dropped(), "%s", "");
>  		return -4;
>  	}
>  
> 
> base-commit: 2d2118b814c11f509e1aa76cb07110f7231668dc
> 

Ack.

On a tangent: what's wrong with empty format strings?

Cheers,
Alban




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux