mtd/partition: fix compile warning
include/nuttx/mtd/mtd.h: In function ‘mtd_setpartitionname’: mtd/mtd_partition.c:909:3: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] 909 | strncpy(priv->name, name, sizeof(priv->name)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
0f7ccf0c08
commit
6a212b1a2c
|
@ -906,7 +906,7 @@ int mtd_setpartitionname(FAR struct mtd_dev_s *mtd, FAR const char *name)
|
||||||
|
|
||||||
/* Allocate space for the name */
|
/* Allocate space for the name */
|
||||||
|
|
||||||
strncpy(priv->name, name, sizeof(priv->name));
|
strlcpy(priv->name, name, sizeof(priv->name));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue