summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-12-21 19:59:38 +0000
committerdelphij <delphij@FreeBSD.org>2009-12-21 19:59:38 +0000
commite3103880d83f1af0b22d4844a1cb8df5f1bed047 (patch)
tree2ae1e68cb84d60149ea5b6933018fe4c7dca36e9 /lib/libc/stdio
parent0ae6c4289dbc0683070f56040e37479b2d50d289 (diff)
downloadFreeBSD-src-e3103880d83f1af0b22d4844a1cb8df5f1bed047.zip
FreeBSD-src-e3103880d83f1af0b22d4844a1cb8df5f1bed047.tar.gz
Use vsprintf instead of rolling our own.
PR: bin/140496 Submitted by: Jeremy Huddleston <jeremyhu apple.com> MFC after: 1 month
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/sprintf.c10
1 files changed, 1 insertions, 9 deletions
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);
}
OpenPOWER on IntegriCloud