mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Li Bin <huawei.libin@huawei.com>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Will Deacon <will.deacon@arm.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] scripts: recordmcount: fix incorrect use of sprintf
Date: Wed, 30 Dec 2015 23:06:41 +0000	[thread overview]
Message-ID: <1451516801-16951-1-git-send-email-colin.king@canonical.com> (raw)

From: Colin Ian King <colin.king@canonical.com>

Fix build warning:

scripts/recordmcount.c:589:4: warning: format not a string
literal and no format arguments [-Wformat-security]
    sprintf("%s: failed\n", file);

Fixes: a50bd43935586 ("ftrace/scripts: Have recordmcount copy the object file")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 scripts/recordmcount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index 301d70b..e1675927 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -586,7 +586,7 @@ main(int argc, char *argv[])
 			do_file(file);
 			break;
 		case SJ_FAIL:    /* error in do_file or below */
-			sprintf("%s: failed\n", file);
+			fprintf(stderr, "%s: failed\n", file);
 			++n_error;
 			break;
 		case SJ_SUCCEED:    /* premature success */
-- 
2.6.4


             reply	other threads:[~2015-12-30 23:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30 23:06 Colin King [this message]
2016-01-04 15:42 ` Steven Rostedt
2016-01-06 11:28   ` Fengguang Wu
2016-01-06 23:13     ` Kees Cook

Reply instructions:

You may reply publicly 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1451516801-16951-1-git-send-email-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=huawei.libin@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=rostedt@goodmis.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®