Просмотр исходного кода

Fix arithmetic done on void pointer

Closes https://github.com/espressif/esp-serial-flasher/pull/15
Jim Paris 5 лет назад
Родитель
Сommit
b8dda36b5d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/serial_comm.c

+ 1 - 1
src/serial_comm.c

@@ -218,7 +218,7 @@ static esp_loader_error_t check_response(command_t cmd, uint32_t *reg_value, voi
         }
         }
     } while ((response->direction != READ_DIRECTION) || (response->command != cmd));
     } while ((response->direction != READ_DIRECTION) || (response->command != cmd));
 
 
-    response_status_t *status = (response_status_t *)(resp + resp_size - sizeof(response_status_t));
+    response_status_t *status = (response_status_t *)((uint8_t *)resp + resp_size - sizeof(response_status_t));
 
 
     if (status->failed) {
     if (status->failed) {
         log_loader_internal_error(status->error);
         log_loader_internal_error(status->error);