Linux-BTRFS Archive on
 help / color / Atom feed
From: Adam Borowski <>
To: David Sterba <>,
Cc: Adam Borowski <>
Subject: [PATCH] btrfs-progs: fix a printf format string fatal warning
Date: Sun, 14 Jul 2019 01:14:54 +0200
Message-ID: <> (raw)

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 <>
 common/format-output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/format-output.c b/common/format-output.c
index c5f1b51f..98fb8607 100644
--- a/common/format-output.c
+++ b/common/format-output.c
@@ -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 {

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-BTRFS Archive on

Archives are clonable:
	git clone --mirror linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ \
	public-inbox-index linux-btrfs

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox