BadUSB and Archive fixes (#2005)

* BsdUsb: fix empty lines handling
* Archive: folders and unknown files rename fix

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-11-12 14:55:42 +03:00
committed by GitHub
parent f9730bcafe
commit 73441af9c6
5 changed files with 11 additions and 12 deletions

View File

@@ -38,7 +38,7 @@ void path_extract_extension(FuriString* path, char* ext, size_t ext_len_max) {
size_t dot = furi_string_search_rchar(path, '.');
size_t filename_start = furi_string_search_rchar(path, '/');
if((dot > 0) && (filename_start < dot)) {
if((dot != FURI_STRING_FAILURE) && (filename_start < dot)) {
strlcpy(ext, &(furi_string_get_cstr(path))[dot], ext_len_max);
}
}