summaryrefslogtreecommitdiff
path: root/misc-utils/mtdpart.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc-utils/mtdpart.c')
-rw-r--r--misc-utils/mtdpart.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc-utils/mtdpart.c b/misc-utils/mtdpart.c
index e480e1b..ba35d87 100644
--- a/misc-utils/mtdpart.c
+++ b/misc-utils/mtdpart.c
@@ -174,7 +174,9 @@ int main(int argc, char * const argv[])
case COMMAND_ADD:
part.start = start_addr;
part.length = length;
- strncpy(part.devname, part_name, sizeof(part.devname));
+ strncpy(part.devname, part_name,
+ sizeof(part.devname) - 1);
+ part.devname[sizeof(part.devname) - 1] = '\0';
arg.op = BLKPG_ADD_PARTITION;
break;
case COMMAND_DEL: