Skip to content

Commit

Permalink
btrfs-progs: fix a printf format string fatal warning
Browse files Browse the repository at this point in the history
At least in Debian, default build flags include -Werror=format-security,
for good reasons in most cases.  Here, the string comes from strftime --
and though I don't suspect any locale would be crazy enough to have %X
include a '%' char, the compiler has no way to know that.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
kilobyte authored and kdave committed Jul 26, 2019
1 parent 608fd90 commit 1e6246e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/format-output.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void fmt_print(struct format_ctx *fctx, const char* key, ...)

localtime_r(&ts, &tm);
strftime(tstr, 256, "%Y-%m-%d %X %z", &tm);
printf(tstr);
printf("%s", tstr);
} else {
putchar('-');
}
Expand Down

0 comments on commit 1e6246e

Please sign in to comment.