From 701580c29c3526ce1ccaeae335733dd2fa5bce8c Mon Sep 17 00:00:00 2001 From: Daniel Walter Date: Tue, 3 Nov 2015 14:50:02 +0100 Subject: Fix scanf() formatstring for modern C version 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 Signed-off-by: Richard Weinberger --- jffsX-utils/mkfs.jffs2.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'jffsX-utils') diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c index f09c0b2..b83c1ee 100644 --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/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 -- cgit v1.2.3