Topic: [Help] Crash on reading file
This code crashes my server...
std::ifstream accFile;
char buf[1024];
char buf2[1024];
str_format(buf, sizeof(buf), "./accounts/%s.acc", name);
accFile.open(buf);
accFile >> buf2;
accFile.close();
return sscanf(buf2, "%s/%d/%d/%d/%d/%d", pass, upgrades[UPGRADE_RELOAD], upgrades[UPGRADE_SPREAD], upgrades[UPGRADE_AUTOFIRE], upgrades[UPGRADE_RANGE], upgrades[UPGRADE_SPAWN]) == 6;
Saving to the same file works. I can not provide further information, because all I know is that it crashes
All the variables exist (pass, upgrades, etc...) and accessing them works, except for pass. When accessing pass, the same happens...
Example of what a file looks like: "password/0/0/0/0/0"
(I hate C++ )