mtd/drivers/mtd/chips jedec.c,1.18,1.19
David Woodhouse
dwmw2 at infradead.org
Thu May 29 05:25:26 EDT 2003
Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv15613/chips
Modified Files:
jedec.c
Log Message:
strlcpy
Index: jedec.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/jedec.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- jedec.c 28 May 2003 12:51:48 -0000 1.18
+++ jedec.c 29 May 2003 09:25:23 -0000 1.19
@@ -174,8 +174,7 @@
/* Generate a part name that includes the number of different chips and
other configuration information */
count = 1;
- strncpy(Part,map->name,sizeof(Part)-10);
- Part[sizeof(Part)-11] = 0;
+ strlcpy(Part,map->name,sizeof(Part)-10);
strcat(Part," ");
Uniq = 0;
for (I = 0; priv->chips[I].jedec != 0 && I < MAX_JEDEC_CHIPS; I++)
@@ -252,8 +251,7 @@
// printk("Part: '%s'\n",Part);
memset(MTD,0,sizeof(*MTD));
- // strncpy(MTD->name,Part,sizeof(MTD->name));
- // MTD->name[sizeof(MTD->name)-1] = 0;
+ // strlcpy(MTD->name,Part,sizeof(MTD->name));
MTD->name = map->name;
MTD->type = MTD_NORFLASH;
MTD->flags = MTD_CAP_NORFLASH;
More information about the linux-mtd-cvs
mailing list