]> www.infradead.org Git - mtd-utils.git/commitdiff
Fix scanf() formatstring for modern C version
authorDaniel Walter <dwalter@sigma-star.at>
Tue, 3 Nov 2015 13:50:02 +0000 (14:50 +0100)
committerRichard Weinberger <richard@nod.at>
Thu, 12 Nov 2015 12:36:39 +0000 (13:36 +0100)
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>
Signed-off-by: Richard Weinberger <richard@nod.at>
jffsX-utils/mkfs.jffs2.c

index f09c0b2da8a78c21d0199c0adaab84c0272880d0..b83c1ee55af1803a2b9ac3b6a31c772901777e7e 100644 (file)
@@ -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