[FL-2431, FL-2419] SubGhz: bugfixes (#1098)
* [FL-2431] SubGhz: fix Restart with an error (HardFault), while maintaining the RAW signal. * Stream: fix adding maximum string length to arguments * [FL-2419] SubGhz: fix flipper hang/Fatal Error when running edited Sub-GHz file. * SubGhz: remove replace strcpy with strncpy, smaller text buffer and canary * SubGhz: log key loading before load happen, rollback only rx message handling Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -297,13 +297,15 @@ bool storage_simply_mkdir(Storage* storage, const char* path);
|
||||
* @param filename
|
||||
* @param fileextension
|
||||
* @param nextfilename return name
|
||||
* @param max_len max len name
|
||||
*/
|
||||
void storage_get_next_filename(
|
||||
Storage* storage,
|
||||
const char* dirname,
|
||||
const char* filename,
|
||||
const char* fileextension,
|
||||
string_t nextfilename);
|
||||
string_t nextfilename,
|
||||
uint8_t max_len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -556,7 +556,8 @@ void storage_get_next_filename(
|
||||
const char* dirname,
|
||||
const char* filename,
|
||||
const char* fileextension,
|
||||
string_t nextfilename) {
|
||||
string_t nextfilename,
|
||||
uint8_t max_len) {
|
||||
string_t temp_str;
|
||||
uint16_t num = 0;
|
||||
|
||||
@@ -566,8 +567,7 @@ void storage_get_next_filename(
|
||||
num++;
|
||||
string_printf(temp_str, "%s/%s%d%s", dirname, filename, num, fileextension);
|
||||
}
|
||||
|
||||
if(num) {
|
||||
if(num && (max_len > strlen(filename))) {
|
||||
string_printf(nextfilename, "%s%d", filename, num);
|
||||
} else {
|
||||
string_printf(nextfilename, "%s", filename);
|
||||
|
Reference in New Issue
Block a user