From c131ae4a6594c63bdf766e000d7576baf8d04f77 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Sun, 26 Jan 2020 19:47:23 +0100 Subject: [PATCH] Fix crash on empty spiffs partition --- src/hasp.cpp | 6 ++---- src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hasp.cpp b/src/hasp.cpp index 1b71bff4..0d7179bd 100644 --- a/src/hasp.cpp +++ b/src/hasp.cpp @@ -1299,14 +1299,12 @@ void haspLoadPage(String pages) char msg[92]; if(!SPIFFS.begin()) { - sprintf_P(msg, PSTR("HASP: \%sFS not mounted. Failed to load %s"), pages.c_str()); - errorPrintln(msg); + errorPrintln(String(F("HASP: %sFS not mounted. Failed to load ")) + pages.c_str()); return; } if(!SPIFFS.exists(pages)) { - sprintf_P(msg, PSTR("HASP: \%sFile '%s' does not exist"), pages.c_str()); - errorPrintln(msg); + errorPrintln(String(F("HASP: %sNon existing file ")) + pages.c_str()); return; } diff --git a/src/main.cpp b/src/main.cpp index 34663048..efe3eaa6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ void setup() /* Init Storage */ eepromSetup(); #if LV_USE_HASP_SPIFFS - // spiffsSetup(); + spiffsSetup(); #endif /* Read Config File */