diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 34d1176a7a..a55b6e8ac5 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2851,7 +2851,7 @@ int MSVCRT_vfprintf(MSVCRT_FILE* file, const char *format, va_list valist) * Return the number of bytes that would have been written * The code below handles both cases */ - while ((written = vsnprintf(mem, resize, format, valist)) == -1 || + while ((written = MSVCRT_vsnprintf(mem, resize, format, valist)) == -1 || written > resize) { resize = (written == -1 ? resize * 2 : written + 1); diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 54c78e4fc5..b6d463740b 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -576,6 +576,7 @@ double MSVCRT_difftime(MSVCRT_time_t time1, MSVCRT_time_t time2); MSVCRT_time_t MSVCRT_time(MSVCRT_time_t*); void * MSVCRT___p__daylight(void); MSVCRT_FILE* MSVCRT__fdopen(int, const char *); +int MSVCRT_vsnprintf(char *str, unsigned int len, const char *format, va_list valist); #ifndef __WINE_MSVCRT_TEST int _write(int,const void*,unsigned int);