stop reading config if there's a zero
most likely corrupt file
This commit is contained in:
parent
4d36bd2336
commit
1cdca76336
5
extern/imgui_patched/imgui.cpp
vendored
5
extern/imgui_patched/imgui.cpp
vendored
|
@ -12478,9 +12478,12 @@ bool ImGui::LoadIniSettingsFromDisk(const char* ini_filename, bool redundancy)
|
|||
if (!file_data) continue;
|
||||
|
||||
for (size_t j=0; j<file_data_size; j++) {
|
||||
if (file_data[j]==0) {
|
||||
viable=false;
|
||||
break;
|
||||
}
|
||||
if (file_data[j]!='\r' && file_data[j]!='\n' && file_data[j]!=' ') {
|
||||
viable=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -148,9 +148,13 @@ bool DivConfig::loadFromFile(const char* path, bool createOnFail, bool redundanc
|
|||
}
|
||||
|
||||
for (size_t j=0; j<readBufLen; j++) {
|
||||
if (readBuf[j]==0) {
|
||||
viable=false;
|
||||
logW("a zero?");
|
||||
break;
|
||||
}
|
||||
if (readBuf[j]!='\r' && readBuf[j]!='\n' && readBuf[j]!=' ') {
|
||||
viable=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue