[FL-1705] Fix IRDA SD eject (#799)

Removing SD card during brut-force causes endless loop.
This is because calling a string_t destructor invalidates
variable, but we did checking string_size() after.

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Albert Kharisov 2021-11-01 21:17:01 +04:00 committed by GitHub
parent 63fe452746
commit b397442d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,7 +367,7 @@ bool file_worker_read_until_buffered(
file_worker->file, &file_buf[*file_buf_cnt], file_buf_size - *file_buf_cnt); file_worker->file, &file_buf[*file_buf_cnt], file_buf_size - *file_buf_cnt);
if(storage_file_get_error(file_worker->file) != FSE_OK) { if(storage_file_get_error(file_worker->file) != FSE_OK) {
file_worker_show_error_internal(file_worker, "Cannot read\nfile"); file_worker_show_error_internal(file_worker, "Cannot read\nfile");
string_clear(str_result); string_clean(str_result);
*file_buf_cnt = 0; *file_buf_cnt = 0;
break; break;
} }