[common/client] windows: avoid deprecated CRT calls

This commit is contained in:
Geoffrey McRae
2026-10-03 09:58:14 +10:00
parent 08b68ff740
commit 2021874ca9
8 changed files with 74 additions and 24 deletions

View File

@@ -234,7 +234,11 @@ static bool savePreset(struct EGL_PostProcess * this, const char * name)
FILE * file = lgOpenFile(path, "w");
if (!file)
{
const char * strError = strerror(errno);
const int errorCode = errno;
char strError[256] = { 0 };
if (!lgFileErrorString(errorCode, strError, sizeof(strError)))
snprintf(strError, sizeof(strError), "Error %d", errorCode);
DEBUG_ERROR("Failed to open preset \"%s\" for writing: %s", name, strError);
free(path);