Skip to content

Commit

Permalink
fix running under WinXP
Browse files Browse the repository at this point in the history
  • Loading branch information
rhash committed Aug 26, 2017
1 parent db0808d commit a3e64cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions win_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,11 @@ int win_vfprintf(FILE* out, const char* format, va_list args)
* can be used only from a single-thread program */
static char buffer[8192];
wchar_t *wstr = NULL;
int res = vsnprintf_s(buffer, 8192, _TRUNCATE, format, args);
if (res < 0)
int res = vsnprintf(buffer, 8192, format, args);
if (res < 0 || res >= 8192)
{
errno = EINVAL;
return res;
return -1;
}
wstr = cstr_to_wchar(buffer, CP_UTF8);
res = fwprintf(out, L"%s", wstr);
Expand Down

0 comments on commit a3e64cb

Please sign in to comment.