git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:00 UTC

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

From
Ralf Thielow via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 27, 2020, 20:25 UTC
Message-ID
<pull.567.git.1582835130592.gitgitgadget@gmail.com>
From: Ralf Thielow <ralf.thielow@gmail.com>
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@gmail.com>
---
    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
-- 
gitgitgadget
Next: Jeff King
Message 1 of 6 in “rebase-interactive.c: silence format-zero-length warnings”
  1. rebase-interactive.c: silence format-zero-length warningsRalf Thielow via GitGitGadget, Feb 27, 2020
  2. config.mak.dev: re-enable -Wformat-zero-lengthJeff King, Feb 27, 2020
  3. Junio C HamanoFeb 28, 2020
  4. Jeff KingFeb 28, 2020
  5. Alban GruinMar 3, 2020
  6. Junio C HamanoMar 3, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.