]> git.sur5r.net Git - u-boot/blobdiff - cmd/mtdparts.c
mtd: nand: Rename nand.h into rawnand.h
[u-boot] / cmd / mtdparts.c
index 72bff92a9aee591060233b5169509ea06b05dffc..3169c33265ce818aa46d93bd55afe49ae80fdd11 100644 (file)
@@ -81,7 +81,7 @@
 #include <linux/mtd/mtd.h>
 
 #if defined(CONFIG_CMD_NAND)
-#include <linux/mtd/nand.h>
+#include <linux/mtd/rawnand.h>
 #include <nand.h>
 #endif
 
@@ -1726,7 +1726,7 @@ int mtdparts_init(void)
        const char *ids, *parts;
        const char *current_partition;
        int ids_changed;
-       char tmp_ep[PARTITION_MAXLEN];
+       char tmp_ep[PARTITION_MAXLEN + 1];
        char tmp_parts[MTDPARTS_MAXLEN];
 
        debug("\n---mtdparts_init---\n");
@@ -1750,7 +1750,8 @@ int mtdparts_init(void)
 
        /* save it for later parsing, cannot rely on current partition pointer
         * as 'partition' variable may be updated during init */
-       tmp_ep[0] = '\0';
+       memset(tmp_parts, 0, sizeof(tmp_parts));
+       memset(tmp_ep, 0, sizeof(tmp_ep));
        if (current_partition)
                strncpy(tmp_ep, current_partition, PARTITION_MAXLEN);