tools/mkfwimage2: remove 256 length limit for partition images
authorAlexander Couzens <lynxis@fe80.eu>
Sat, 11 Jun 2016 02:12:38 +0000 (04:12 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Wed, 15 Jun 2016 05:13:37 +0000 (22:13 -0700)
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
src/mkfwimage2.c

index 146b2ad55d7a8a58b61dbcdc3034ff5449350ff3..89a98051b430e7077045ef89601f2418e189b920 100644 (file)
@@ -197,6 +197,10 @@ int str2u32(char *arg, u_int32_t *val)
        return 0;
 }
 
+#ifndef STRINGIFY
+#define STRINGIFY2(X) #X
+#define STRINGIFY(X) STRINGIFY2(X)
+#endif
 static int image_layout_add_partition(const char *part_desc)
 {
        part_data_t *d;
@@ -212,7 +216,7 @@ static int image_layout_add_partition(const char *part_desc)
        }
 
        d = &im.parts[im.part_count];
-       t = sscanf(part_desc, "%15[-0-9a-zA-Z]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%256s",
+       t = sscanf(part_desc, "%15[-0-9a-zA-Z]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%15[0-9a-fA-Fx]:%"STRINGIFY(PATH_MAX)"s",
                        d->partition_name,
                        offset,
                        length,