Commit 0decbf85 authored by deuce's avatar deuce
Browse files

Set numchars to size-1 if it's >= size... NOTICE: This is not "correct"

snprintf() behaviour!
parent 8864adc7
......@@ -75,6 +75,8 @@ 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);
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