I was mistaken. Borland and gcc do have snprintf() and vsnprintf()
[p5sagit/p5-mst-13.2.git] / perlio.c
index 8d8a4ec..24f419f 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -5143,7 +5143,7 @@ PerlIO_vsprintf(char *s, int n, const char *fmt, va_list ap)
 {
     dVAR;
 #ifdef USE_VSNPRINTF
-    const int val = vsnprintf(s, n, fmt, ap);
+    const int val = vsnprintf(s, n > 0 ? n : 0, fmt, ap);
 #else
     const int val = vsprintf(s, fmt, ap);
 #endif /* #ifdef USE_VSNPRINTF */