Fix uninitialized filename (#1838)

* fix the uninitialized filename. It only got used for the logging in case the file exists but failed to get loaded (eg. /sdcard/log/data/data_2023-01-14.csv)

* .

Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
CaCO3
2023-01-14 23:11:52 +01:00
committed by GitHub
parent 17d85ae523
commit 52296b3cb6
2 changed files with 7 additions and 11 deletions

View File

@@ -41,7 +41,7 @@ esp_err_t send_file(httpd_req_t *req, std::string filename)
{
FILE *fd = fopen(filename.c_str(), "r");
if (!fd) {
ESP_LOGE(TAG, "Failed to read existing file: %s", filename.c_str());
ESP_LOGE(TAG, "Failed to read file: %s", filename.c_str());
/* Respond with 404 Error */
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
return ESP_FAIL;