mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spiffs: fix format-truncation warning
This commit is contained in:
parent
06df46e26a
commit
e7bfc44caf
@ -667,7 +667,8 @@ static int vfs_spiffs_readdir_r(void* ctx, DIR* pdir, struct dirent* entry,
|
||||
}
|
||||
entry->d_ino = 0;
|
||||
entry->d_type = out.type;
|
||||
snprintf(entry->d_name, SPIFFS_OBJ_NAME_LEN, "%s", item_name);
|
||||
strncpy(entry->d_name, item_name, SPIFFS_OBJ_NAME_LEN);
|
||||
entry->d_name[SPIFFS_OBJ_NAME_LEN - 1] = '\0';
|
||||
dir->offset++;
|
||||
*out_dirent = entry;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user