From a4a741f7cfab4f58efbc70e19b70b498c81b0748 Mon Sep 17 00:00:00 2001 From: millert Date: Mon, 12 Jan 1998 06:14:30 +0000 Subject: 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(). --- lib/libc/stdio/vsprintf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/libc/stdio/vsprintf.c') diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c index 09c34ba71c9..665d9e1de3e 100644 --- a/lib/libc/stdio/vsprintf.c +++ b/lib/libc/stdio/vsprintf.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.2 1996/08/19 08:33:14 tholo Exp $"; +static char rcsid[] = "$OpenBSD: vsprintf.c,v 1.3 1998/01/12 06:14:32 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -49,10 +49,11 @@ vsprintf(str, fmt, ap) int ret; FILE f; + f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = INT_MAX; ret = vfprintf(&f, fmt, ap); - *f._p = 0; + *f._p = '\0'; return (ret); } -- cgit v1.2.3-59-g8ed1b