forked from Mirrors/btrfs-progs
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
parent
608fd900ca
commit
1e6246eaec
|
@ -280,7 +280,7 @@ void fmt_print(struct format_ctx *fctx, const char* key, ...)
|
||||||
|
|
||||||
localtime_r(&ts, &tm);
|
localtime_r(&ts, &tm);
|
||||||
strftime(tstr, 256, "%Y-%m-%d %X %z", &tm);
|
strftime(tstr, 256, "%Y-%m-%d %X %z", &tm);
|
||||||
printf(tstr);
|
printf("%s", tstr);
|
||||||
} else {
|
} else {
|
||||||
putchar('-');
|
putchar('-');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue