Max file name length is actually 253 + null term

More than that and fatfs will truncate like name~1
Also dir_read already accounts for null term in buf size, dont malloc +1
This commit is contained in:
Willy-JL
2023-06-13 03:10:10 +01:00
parent 45bdbca501
commit 4ecab40fde
11 changed files with 25 additions and 19 deletions

View File

@@ -11,6 +11,8 @@
#define TAG "libmgr"
#define MAX_NAME_LEN 254
ARRAY_DEF(FlipperApplicationList, FlipperApplication*, M_PTR_OPLIST)
#define M_OPL_FlipperApplicationList_t() ARRAY_OPLIST(FlipperApplicationList, M_PTR_OPLIST)
@@ -103,7 +105,7 @@ PluginManagerError plugin_manager_load_single(PluginManager* manager, const char
PluginManagerError plugin_manager_load_all(PluginManager* manager, const char* path) {
File* directory = storage_file_alloc(manager->storage);
char file_name_buffer[256];
char file_name_buffer[MAX_NAME_LEN];
FuriString* file_name = furi_string_alloc();
do {
if(!storage_dir_open(directory, path)) {