components/spi_flash/partition.c: In function 'load_partitions':
components/spi_flash/partition.c:179:66: error: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
strncpy(item->info.label, (const char*) it->label, sizeof(it->label));
^
fl_ota_data_erase = true;
}
// partition->label is not null-terminated string.
- strncpy(label, (char *)&partition->label, sizeof(partition->label));
+ strncpy(label, (char *)&partition->label, sizeof(label) - 1);
if (fl_ota_data_erase == true || (bootloader_common_label_search(list_erase, label) == true)) {
err = esp_rom_spiflash_erase_area(partition->pos.offset, partition->pos.size);
if (err != ESP_OK) {
}
// it->label may not be zero-terminated
- strncpy(item->info.label, (const char*) it->label, sizeof(it->label));
+ strncpy(item->info.label, (const char*) it->label, sizeof(item->info.label) - 1);
item->info.label[sizeof(it->label)] = 0;
// add it to the list
if (last == NULL) {