diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c index e8792e24f8..b7dd47c86f 100644 --- a/drivers/mtd/mtd_partition.c +++ b/drivers/mtd/mtd_partition.c @@ -906,7 +906,7 @@ int mtd_setpartitionname(FAR struct mtd_dev_s *mtd, FAR const char *name) /* Allocate space for the name */ - strncpy(priv->name, name, sizeof(priv->name)); + strlcpy(priv->name, name, sizeof(priv->name)); return OK; } #endif