* [PATCH] Fix scanf() formatstring for modern C version
@ 2015-11-03 13:50 Daniel Walter
2015-11-12 12:37 ` Richard Weinberger
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Walter @ 2015-11-03 13:50 UTC (permalink / raw)
To: linux-mtd; +Cc: richard
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix scanf() formatstring for modern C version
2015-11-03 13:50 [PATCH] Fix scanf() formatstring for modern C version Daniel Walter
@ 2015-11-12 12:37 ` Richard Weinberger
0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2015-11-12 12:37 UTC (permalink / raw)
To: Daniel Walter; +Cc: linux-mtd, Richard Weinberger
On Tue, Nov 3, 2015 at 2:50 PM, Daniel Walter <dwalter@sigma-star.at> wrote:
> 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>
Applied and pushed!
--
Thanks,
//richard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-12 12:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03 13:50 [PATCH] Fix scanf() formatstring for modern C version Daniel Walter
2015-11-12 12:37 ` Richard Weinberger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.