Fix unitialized variable

This commit is contained in:
Marek Kraus 2022-11-08 16:21:13 +01:00
parent 7795de96ff
commit c7bbb0a797

View File

@ -36,6 +36,8 @@ get_binary_folder(char* buffer, uint32_t buffer_size) {
}
void blisp_flash_firmware() {
FILE* eflash_loader_file = NULL;
// TODO: We support currently only BL70X
if (chip_type->count == 0 || strcmp(chip_type->sval[0], "bl70x") != 0) {
fprintf(stderr, "Chip type is invalid.\n");
@ -94,7 +96,7 @@ void blisp_flash_firmware() {
get_binary_folder(exe_path, PATH_MAX); // TODO: Error handling
snprintf(eflash_loader_path, PATH_MAX, "%s/data/%s/eflash_loader_32m.bin", exe_path, device.chip->type_str);
FILE* eflash_loader_file = fopen(eflash_loader_path, "rb"); // TODO: Error handling
eflash_loader_file = fopen(eflash_loader_path, "rb"); // TODO: Error handling
uint8_t eflash_loader_header[176];
fread(eflash_loader_header, 176, 1, eflash_loader_file); // TODO: Error handling
@ -157,7 +159,6 @@ void blisp_flash_firmware() {
eflash_loader:
exit1:
if (eflash_loader_file != NULL) fclose(eflash_loader_file);
blisp_device_close(&device);