btrfs-progs: fix a printf format string fatal warning

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>
master
Adam Borowski 2019-07-14 01:14:54 +02:00 committed by David Sterba
parent 608fd900ca
commit 1e6246eaec
1 changed files with 1 additions and 1 deletions

View File

@ -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('-');
}