mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
Replace all strncpy with strlcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Alin Jerpelea
parent
6f6fce95a2
commit
325f395300
@@ -186,8 +186,7 @@ static int init_ota_partitions(void)
|
||||
const struct ota_partition_s *part = &g_ota_partition_table[i];
|
||||
mtd = progmem_alloc_mtdpart(part->offset, part->size);
|
||||
|
||||
strncpy(path, (char *)part->devpath, PARTITION_LABEL_LEN);
|
||||
path[PARTITION_LABEL_LEN] = '\0';
|
||||
strlcpy(path, (char *)part->devpath, PARTITION_LABEL_LEN);
|
||||
|
||||
finfo("INFO: [label]: %s\n", path);
|
||||
finfo("INFO: [offset]: 0x%08" PRIx32 "\n", part->offset);
|
||||
|
||||
@@ -187,8 +187,7 @@ static int init_ota_partitions(void)
|
||||
const struct ota_partition_s *part = &g_ota_partition_table[i];
|
||||
mtd = progmem_alloc_mtdpart(part->offset, part->size);
|
||||
|
||||
strncpy(path, (char *)part->devpath, PARTITION_LABEL_LEN);
|
||||
path[PARTITION_LABEL_LEN] = '\0';
|
||||
strlcpy(path, (char *)part->devpath, PARTITION_LABEL_LEN);
|
||||
|
||||
finfo("INFO: [label]: %s\n", path);
|
||||
finfo("INFO: [offset]: 0x%08" PRIx32 "\n", part->offset);
|
||||
|
||||
Reference in New Issue
Block a user