From e3103880d83f1af0b22d4844a1cb8df5f1bed047 Mon Sep 17 00:00:00 2001 From: delphij Date: Mon, 21 Dec 2009 19:59:38 +0000 Subject: Use vsprintf instead of rolling our own. PR: bin/140496 Submitted by: Jeremy Huddleston MFC after: 1 month --- lib/libc/stdio/sprintf.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/stdio/sprintf.c b/lib/libc/stdio/sprintf.c index aaaae55..b55bd6c 100644 --- a/lib/libc/stdio/sprintf.c +++ b/lib/libc/stdio/sprintf.c @@ -46,17 +46,9 @@ sprintf(char * __restrict str, char const * __restrict fmt, ...) { int ret; va_list ap; - FILE f; - f._file = -1; - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *)str; - f._bf._size = f._w = INT_MAX; - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); va_start(ap, fmt); - ret = __vfprintf(&f, fmt, ap); + ret = vsprintf(str, fmt, ap); va_end(ap); - *f._p = 0; return (ret); } -- cgit v1.1