summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-29 23:35:52 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-29 23:35:52 +0000
commit6a841143011641ad36ad4f8e2f2896eb0e1a59dc (patch)
tree0b01325f2d6b4ef018f9959f5d352ba3314cf4e9 /perlio.c
parentc9cb0f4189a96c284198e261ba3e6a7df9d31f55 (diff)
downloadperl-6a841143011641ad36ad4f8e2f2896eb0e1a59dc.tar.gz
Coverity disliked us passing a negative length to vsnprintf().
p4raw-id: //depot/perl@28020
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/perlio.c b/perlio.c
index 8d8a4ec201..24f419f264 100644
--- 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 */