From 6e6d19008bc00877ef94124cdeaede817bdf969f Mon Sep 17 00:00:00 2001 From: Xin LI Date: Wed, 20 Jan 2010 00:53:44 +0000 Subject: [PATCH] MFC r200802: Use vsprintf instead of rolling our own. PR: bin/140496 Submitted by: Jeremy Huddleston --- lib/libc/stdio/sprintf.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/libc/stdio/sprintf.c b/lib/libc/stdio/sprintf.c index aaaae5535d2..b55bd6cfa2c 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); }