Skip to content

Commit 09e141f

Browse files
committed
Merge branch 'fc/status-printf-squelch-format-zero-length-warnings'
* fc/status-printf-squelch-format-zero-length-warnings: silence a bunch of format-zero-length warnings
2 parents 610a14f + 7d7d680 commit 09e141f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

builtin/commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
848848
(int)(ci.mail_end - ci.mail_begin), ci.mail_begin);
849849

850850
if (ident_shown)
851-
status_printf_ln(s, GIT_COLOR_NORMAL, "");
851+
status_printf_ln(s, GIT_COLOR_NORMAL, "%s", "");
852852

853853
saved_color_setting = s->use_color;
854854
s->use_color = 0;

wt-status.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
188188
} else {
189189
status_printf_ln(s, c, _(" (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
190190
}
191-
status_printf_ln(s, c, "");
191+
status_printf_ln(s, c, "%s", "");
192192
}
193193

194194
static void wt_status_print_cached_header(struct wt_status *s)
@@ -204,7 +204,7 @@ static void wt_status_print_cached_header(struct wt_status *s)
204204
status_printf_ln(s, c, _(" (use \"git reset %s <file>...\" to unstage)"), s->reference);
205205
else
206206
status_printf_ln(s, c, _(" (use \"git rm --cached <file>...\" to unstage)"));
207-
status_printf_ln(s, c, "");
207+
status_printf_ln(s, c, "%s", "");
208208
}
209209

210210
static void wt_status_print_dirty_header(struct wt_status *s,
@@ -223,7 +223,7 @@ static void wt_status_print_dirty_header(struct wt_status *s,
223223
status_printf_ln(s, c, _(" (use \"git checkout -- <file>...\" to discard changes in working directory)"));
224224
if (has_dirty_submodules)
225225
status_printf_ln(s, c, _(" (commit or discard the untracked or modified content in submodules)"));
226-
status_printf_ln(s, c, "");
226+
status_printf_ln(s, c, "%s", "");
227227
}
228228

229229
static void wt_status_print_other_header(struct wt_status *s,
@@ -235,12 +235,12 @@ static void wt_status_print_other_header(struct wt_status *s,
235235
if (!s->hints)
236236
return;
237237
status_printf_ln(s, c, _(" (use \"git %s <file>...\" to include in what will be committed)"), how);
238-
status_printf_ln(s, c, "");
238+
status_printf_ln(s, c, "%s", "");
239239
}
240240

241241
static void wt_status_print_trailer(struct wt_status *s)
242242
{
243-
status_printf_ln(s, color(WT_STATUS_HEADER, s), "");
243+
status_printf_ln(s, color(WT_STATUS_HEADER, s), "%s", "");
244244
}
245245

246246
#define quote_path quote_path_relative
@@ -826,7 +826,7 @@ static void wt_status_print_other(struct wt_status *s,
826826
string_list_clear(&output, 0);
827827
strbuf_release(&buf);
828828
conclude:
829-
status_printf_ln(s, GIT_COLOR_NORMAL, "");
829+
status_printf_ln(s, GIT_COLOR_NORMAL, "%s", "");
830830
}
831831

832832
void wt_status_truncate_message_at_cut_line(struct strbuf *buf)
@@ -913,7 +913,7 @@ static void wt_status_print_tracking(struct wt_status *s)
913913
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "%c",
914914
comment_line_char);
915915
else
916-
fprintf_ln(s->fp, "");
916+
fputs("", s->fp);
917917
}
918918

919919
static int has_unmerged(struct wt_status *s)
@@ -1329,7 +1329,7 @@ void wt_status_print(struct wt_status *s)
13291329
on_what = _("Not currently on any branch.");
13301330
}
13311331
}
1332-
status_printf(s, color(WT_STATUS_HEADER, s), "");
1332+
status_printf(s, color(WT_STATUS_HEADER, s), "%s", "");
13331333
status_printf_more(s, branch_status_color, "%s", on_what);
13341334
status_printf_more(s, branch_color, "%s\n", branch_name);
13351335
if (!s->is_initial)
@@ -1342,9 +1342,9 @@ void wt_status_print(struct wt_status *s)
13421342
free(state.detached_from);
13431343

13441344
if (s->is_initial) {
1345-
status_printf_ln(s, color(WT_STATUS_HEADER, s), "");
1345+
status_printf_ln(s, color(WT_STATUS_HEADER, s), "%s", "");
13461346
status_printf_ln(s, color(WT_STATUS_HEADER, s), _("Initial commit"));
1347-
status_printf_ln(s, color(WT_STATUS_HEADER, s), "");
1347+
status_printf_ln(s, color(WT_STATUS_HEADER, s), "%s", "");
13481348
}
13491349

13501350
wt_status_print_updated(s);
@@ -1361,7 +1361,7 @@ void wt_status_print(struct wt_status *s)
13611361
if (s->show_ignored_files)
13621362
wt_status_print_other(s, &s->ignored, _("Ignored files"), "add -f");
13631363
if (advice_status_u_option && 2000 < s->untracked_in_ms) {
1364-
status_printf_ln(s, GIT_COLOR_NORMAL, "");
1364+
status_printf_ln(s, GIT_COLOR_NORMAL, "%s", "");
13651365
status_printf_ln(s, GIT_COLOR_NORMAL,
13661366
_("It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
13671367
"may speed it up, but you have to be careful not to forget to add\n"

0 commit comments

Comments
 (0)