Fixed log message trunction on Windows.
[yaz-moved-to-github.git] / src / snprintf.c
index 0221f97..a3903ed 100644 (file)
@@ -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);
 #else
 #ifdef WIN32
-    _vsnprintf(buf, size, fmt, ap);
+    _vsnprintf(buf, size-1, fmt, ap);
+    buf[size-1] = '\0';
 #else
     vsprintf(buf, fmt, ap);
 #endif
 #else
     vsprintf(buf, fmt, ap);
 #endif