summaryrefslogtreecommitdiff
path: root/contrib/amd/libamu/xutil.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1999-09-23 05:15:28 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1999-09-23 05:15:28 +0000
commit98d735b5ee5489d06977293206657757d1753171 (patch)
tree394792aeb26b318df32ca264a4f88b7efe085675 /contrib/amd/libamu/xutil.c
parent9d75443c59613460b61c72a92f5fa07b7402c070 (diff)
parentbceb780b84ed334dd7fc5633332a9dd386f2f451 (diff)
Notes
Diffstat (limited to 'contrib/amd/libamu/xutil.c')
-rw-r--r--contrib/amd/libamu/xutil.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/amd/libamu/xutil.c b/contrib/amd/libamu/xutil.c
index 5ba4938f9ae7..bd1bcf576ef5 100644
--- a/contrib/amd/libamu/xutil.c
+++ b/contrib/amd/libamu/xutil.c
@@ -422,13 +422,17 @@ real_plog(int lvl, char *fmt, va_list vargs)
expand_error(fmt, efmt, 1024);
+#ifdef HAVE_VSNPRINTF
+ vsnprintf(ptr, 1024, efmt, vargs);
+#else /* not HAVE_VSNPRINTF */
/*
* XXX: ptr is 1024 bytes long. It is possible to write into it
* more than 1024 bytes, if efmt is already large, and vargs expand
- * as well.
+ * as well. This is not as safe as using vsnprintf().
*/
vsprintf(ptr, efmt, vargs);
msg[1023] = '\0'; /* null terminate, to be sure */
+#endif /* not HAVE_VSNPRINTF */
ptr += strlen(ptr);
if (ptr[-1] == '\n')