diff --git a/lib/framework/FactoryResetService.cpp b/lib/framework/FactoryResetService.cpp index bcf1029e9..46a6443d8 100644 --- a/lib/framework/FactoryResetService.cpp +++ b/lib/framework/FactoryResetService.cpp @@ -25,9 +25,10 @@ void FactoryResetService::factoryReset() { File root = fs->open(FS_CONFIG_DIRECTORY); File file; while (file = root.openNextFile()) { - char * pathStr = strdup(file.name()); + String path = file.path(); file.close(); - fs->remove(pathStr); + fs->remove(path); } + RestartService::restartNow(); }