linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Walter <dwalter@sigma-star.at>
To: linux-mtd@lists.infradead.org
Cc: richard@nod.at
Subject: [PATCH] Fix scanf() formatstring for modern C version
Date: Tue, 3 Nov 2015 14:50:02 +0100	[thread overview]
Message-ID: <20151103135002.GA21871@dw> (raw)

mkfs.jffs2 is using an old assignment-allocation
modifier for scanf(). Add a check so this modifier
does not get confused with a float formatstring
on newer C standard (C99 onwards).

Signed-off-by: Daniel Walter <dwalter@sigma-star.at>
---
 mkfs.jffs2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
index f09c0b2..b83c1ee 100644
--- a/mkfs.jffs2.c
+++ b/mkfs.jffs2.c
@@ -376,7 +376,11 @@ static struct filesystem_entry *recursive_add_host_directory(
  */
 
 #ifdef __GNUC__
+#if __STDC_VERSION__ >= 199901L
+#define SCANF_PREFIX "m"
+#else
 #define SCANF_PREFIX "a"
+#endif
 #define SCANF_STRING(s) (&s)
 #define GETCWD_SIZE 0
 #else
-- 
2.6.2

             reply	other threads:[~2015-11-03 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 13:50 Daniel Walter [this message]
2015-11-12 12:37 ` [PATCH] Fix scanf() formatstring for modern C version Richard Weinberger

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=20151103135002.GA21871@dw \
    --to=dwalter@sigma-star.at \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /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;
as well as URLs for NNTP newsgroup(s).