Windows doesn't have sterror_r

This commit is contained in:
Zach Bacon 2017-05-11 21:34:18 -04:00
parent 8840b62b27
commit dd34951d2f
1 changed files with 4 additions and 0 deletions

View File

@ -765,7 +765,11 @@ void SaveConfigFile()
FILE *f = fopen(configFile, "w");
if (f == NULL) {
char err_msg[4096] = "unknown error";
#ifdef _WIN32
sterror_s(errno, err_msg, 4096);
#else
strerror_r(errno, err_msg, 4096);
#endif
fprintf(stderr, "Configuration file '%s' could not be written to: %s\n", configFile, err_msg);
return;
}