From: "Ralf Thielow via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Alban Gruin <alban.gruin@gmail.com>,
Ralf Thielow <ralf.thielow@gmail.com>,
Ralf Thielow <ralf.thielow@gmail.com>
Subject: [PATCH] rebase-interactive.c: silence format-zero-length warnings
Date: Thu, 27 Feb 2020 20:25:30 +0000 [thread overview]
Message-ID: <pull.567.git.1582835130592.gitgitgadget@gmail.com> (raw)
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 reply other threads:[~2020-02-27 20:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 20:25 Ralf Thielow via GitGitGadget [this message]
2020-02-27 23:54 ` [PATCH] config.mak.dev: re-enable -Wformat-zero-length Jeff King
2020-02-28 16:42 ` Junio C Hamano
2020-02-28 17:06 ` Jeff King
2020-03-03 10:17 ` [PATCH] rebase-interactive.c: silence format-zero-length warnings Alban Gruin
2020-03-03 14:20 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.567.git.1582835130592.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=alban.gruin@gmail.com \
--cc=git@vger.kernel.org \
--cc=ralf.thielow@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).