diff options
-rw-r--r-- | cmd/mtdparts.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index 72bff92a9a..6e12275b40 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -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,7 @@ 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)); if (current_partition) strncpy(tmp_ep, current_partition, PARTITION_MAXLEN); |