fix one potential crash bug

This commit is contained in:
Arisotura
2024-06-15 17:42:26 +02:00
parent 8fc403cdad
commit ccc5c955e9
3 changed files with 28 additions and 20 deletions

View File

@ -723,19 +723,9 @@ bool Load()
void Save()
{
auto cfgpath = Platform::GetLocalFilePath(kConfigFile);
printf("save\n");
if (!Platform::CheckFileWritable(cfgpath))
return;
printf("zirz\n");
/*RootTable["test"] = 4444;
RootTable["teste.derp"] = 5555;
RootTable["testa"]["fazil"] = 6666;*/
//std::string derp = "sfsdf";
//toml::serializer<std::string> vorp(RootTable);
//toml::serializer<toml::string> zarp;
//std::cout << RootTable;
printf("blarg\n");
std::ofstream file;
file.open(cfgpath, std::ofstream::out | std::ofstream::trunc);
file << RootTable;