From 28aff9c6b19639bae2b3dc28bb6b768c650f5310 Mon Sep 17 00:00:00 2001 From: Rop Gonggrijp Date: Mon, 19 Feb 2024 11:35:18 +0100 Subject: [PATCH] Fix in settings --- src/Settings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Settings.cpp b/src/Settings.cpp index f5affc7..8ff0ea4 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -89,7 +89,7 @@ bool Settings::rm(const String filename) { return false; } if (SPIFFS.remove(actual_filename)) { - INFO("File '%s' deleted.\r\n", filename.c_str()); + INFO("File '%s' deleted.\n", filename.c_str()); return true; } ERROR("ERROR: rm '%s': file not found.\n", filename); @@ -127,9 +127,11 @@ bool Settings::fromList(String in) { break; } String this_one = in.substring(0, lf); - int equals_sign = in.indexOf("="); + int equals_sign = this_one.indexOf("="); if (equals_sign != -1) { store[this_one.substring(0, equals_sign)] = this_one.substring(equals_sign + 1); + } else { + store[this_one.substring(0, equals_sign)] = ""; } in = in.substring(lf + 1); }