Commit 21b1f01d authored by deuce's avatar deuce
Browse files

For MSC, if numbytes == -1 set to adjusted string length.

parent 76a83bee
......@@ -75,9 +75,13 @@ int DLLCALL safe_snprintf(char *dst, size_t size, const char *fmt, ...)
va_start(argptr,fmt);
numchars= vsnprintf(dst,size,fmt,argptr);
va_end(argptr);
dst[size-1]=0;
#ifdef _MSC_VER
if(numchars==-1)
nuchars=strlen(dst);
#endif
if(numchars>=size && numchars>0)
numchars=size-1;
dst[size-1]=0;
return(numchars);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment