Skip to content

Commit 6125104

Browse files
committed
Merge branch 'rt/format-zero-length-fix'
Recently we inadvertently added a few instances of using 0-width format string to functions that we mark as printf-like without any developers noticing. The root cause was that the compiler warning that is triggered by this is almost always useless and we disabled the warning in our developer builds, but not for general public. The new instances have been corrected, and the warning has been resurrected in the developer builds. * rt/format-zero-length-fix: config.mak.dev: re-enable -Wformat-zero-length rebase-interactive.c: silence format-zero-length warnings
2 parents 1ac37de + 7329d94 commit 6125104

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

config.mak.dev

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ endif
99
DEVELOPER_CFLAGS += -Wall
1010
DEVELOPER_CFLAGS += -Wdeclaration-after-statement
1111
DEVELOPER_CFLAGS += -Wformat-security
12-
DEVELOPER_CFLAGS += -Wno-format-zero-length
1312
DEVELOPER_CFLAGS += -Wold-style-definition
1413
DEVELOPER_CFLAGS += -Woverflow
1514
DEVELOPER_CFLAGS += -Wpointer-arith

rebase-interactive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ int edit_todo_list(struct repository *r, struct todo_list *todo_list,
129129

130130
if (incorrect) {
131131
if (todo_list_check_against_backup(r, new_todo)) {
132-
write_file(rebase_path_dropped(), "");
132+
write_file(rebase_path_dropped(), "%s", "");
133133
return -4;
134134
}
135135

136136
if (incorrect > 0)
137137
unlink(rebase_path_dropped());
138138
} else if (todo_list_check(todo_list, new_todo)) {
139-
write_file(rebase_path_dropped(), "");
139+
write_file(rebase_path_dropped(), "%s", "");
140140
return -4;
141141
}
142142

0 commit comments

Comments
 (0)