[FL-2811] Fix PVS-Studio warnings (#2142)

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
Georgii Surkov
2022-12-26 15:13:30 +03:00
committed by GitHub
parent ad3bff0b67
commit 8582670a34
201 changed files with 719 additions and 743 deletions

View File

@@ -18,15 +18,12 @@ bool validator_is_file_callback(const char* text, FuriString* error, void* conte
}
}
bool ret = true;
FuriString* path = furi_string_alloc_printf(
"%s/%s%s", instance->app_path_folder, text, instance->app_extension);
Storage* storage = furi_record_open(RECORD_STORAGE);
if(storage_common_stat(storage, furi_string_get_cstr(path), NULL) == FSE_OK) {
ret = false;
const bool ret = storage_common_stat(storage, furi_string_get_cstr(path), NULL) != FSE_OK;
if(!ret) {
furi_string_printf(error, "This name\nexists!\nChoose\nanother one.");
} else {
ret = true;
}
furi_string_free(path);
furi_record_close(RECORD_STORAGE);