Commit 732221fd authored by deuce's avatar deuce
Browse files

Make safe_snprintf() safer.

parent 18fbb6a0
......@@ -67,7 +67,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);
dst[size-1]=0;
if (size > 0)
dst[size-1]=0;
#ifdef _MSC_VER
if(numchars==-1)
numchars=strlen(dst);
......
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