Skip to content
Snippets Groups Projects
Commit 21b1f01d authored by deuce's avatar deuce
Browse files

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

parent 76a83bee
Branches
Tags
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment