summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vasprintf.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-01-12 06:14:30 +0000
committermillert <millert@openbsd.org>1998-01-12 06:14:30 +0000
commita4a741f7cfab4f58efbc70e19b70b498c81b0748 (patch)
tree5100f22859b08302417ecb5fd5612e93cf0ae7d6 /lib/libc/stdio/vasprintf.c
parentcvs server: nothing known about share/man/man8/rc.conf.8 (diff)
downloadwireguard-openbsd-a4a741f7cfab4f58efbc70e19b70b498c81b0748.tar.xz
wireguard-openbsd-a4a741f7cfab4f58efbc70e19b70b498c81b0748.zip
Based on some FreeBSD changes:
For *s*printf, set f._file to -1 like the comments in stdio.h say. Use '\0', not 0, where appropriate. Don't error out on size of '0' for v?snprintf().
Diffstat (limited to 'lib/libc/stdio/vasprintf.c')
-rw-r--r--lib/libc/stdio/vasprintf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c
index e11f33b7dff..5e8fa0ec932 100644
--- a/lib/libc/stdio/vasprintf.c
+++ b/lib/libc/stdio/vasprintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vasprintf.c,v 1.1 1997/11/29 19:54:47 millert Exp $ */
+/* $OpenBSD: vasprintf.c,v 1.2 1998/01/12 06:14:32 millert Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vasprintf.c,v 1.1 1997/11/29 19:54:47 millert Exp $";
+static char rcsid[] = "$OpenBSD: vasprintf.c,v 1.2 1998/01/12 06:14:32 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -47,6 +47,7 @@ vasprintf(str, fmt, ap)
int ret;
FILE f;
+ f._file = -1;
f._flags = __SWR | __SSTR | __SALC;
f._bf._base = f._p = (unsigned char *)malloc(128);
if (f._bf._base == NULL) {