mtd/drivers/mtd cmdlinepart.c,1.9,1.10

David Woodhouse dwmw2 at infradead.org
Thu May 29 05:25:25 EDT 2003


Update of /home/cvs/mtd/drivers/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv15613

Modified Files:
	cmdlinepart.c 
Log Message:
strlcpy

Index: cmdlinepart.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/cmdlinepart.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- cmdlinepart.c	16 May 2003 17:08:24 -0000	1.9
+++ cmdlinepart.c	29 May 2003 09:25:22 -0000	1.10
@@ -28,6 +28,7 @@
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/compatmac.h>
 #include <asm/setup.h>
 #include <linux/bootmem.h>
 
@@ -178,8 +179,7 @@
 	parts[this_part].mask_flags = mask_flags;
 	if (name)
 	{
-		strncpy(extra_mem, name, name_len);
-		extra_mem[name_len] = 0;
+		strlcpy(extra_mem, name, name_len + 1);
 	}
 	else
 	{
@@ -258,8 +258,7 @@
 		this_mtd->parts = parts;
 		this_mtd->num_parts = num_parts;
 		this_mtd->mtd_id = (char*)(this_mtd + 1);
-		strncpy(this_mtd->mtd_id, mtd_id, mtd_id_len);
-		this_mtd->mtd_id[mtd_id_len] = 0;
+		strlcpy(this_mtd->mtd_id, mtd_id, mtd_id_len + 1);
 
 		/* link into chain */
 		this_mtd->next = partitions;	    	




More information about the linux-mtd-cvs mailing list