X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsnprintf.c;h=a3903ed525701d6d550a110e89e459ad31b22620;hp=0221f977b31cd1ed6ae078e3986fbc6fafe2856e;hb=2ba84b155219d5d18eed5ba4d929c12abdb88f14;hpb=bc384649b00fed1e378ac3f67b8b5e4872892942 diff --git a/src/snprintf.c b/src/snprintf.c index 0221f97..a3903ed 100644 --- a/src/snprintf.c +++ b/src/snprintf.c @@ -17,7 +17,8 @@ void yaz_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap) vsnprintf(buf, size, fmt, ap); #else #ifdef WIN32 - _vsnprintf(buf, size, fmt, ap); + _vsnprintf(buf, size-1, fmt, ap); + buf[size-1] = '\0'; #else vsprintf(buf, fmt, ap); #endif