summaryrefslogtreecommitdiff
path: root/libc/stdio/vsnprintf.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-04-09 19:51:18 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-04-09 19:51:18 +0000
commit36ac7bee0f6b0be35eafd74e0fc865edd2352197 (patch)
treeb557dfbf03da9612bc09906fa3fb7559f556fed8 /libc/stdio/vsnprintf.c
parentf1459b13206cee20f322a53bb659a8735e2c8de0 (diff)
Factor out the core of vprintf() into separate function
vprintf_internal, so that: * vprintf() does locking and __STDIO_STREAM_TRANS_TO_WRITE thing, then calls vprintf_internal * vsnprintf, vdprintf.c, vasprintf.c use vprintf_internal directly This makes sprintf faster (since it doesn't do any locking) and stops it from pulling in fseek in static compile.
Diffstat (limited to 'libc/stdio/vsnprintf.c')
-rw-r--r--libc/stdio/vsnprintf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libc/stdio/vsnprintf.c b/libc/stdio/vsnprintf.c
index 51aaf43d0..4eef2c1a0 100644
--- a/libc/stdio/vsnprintf.c
+++ b/libc/stdio/vsnprintf.c
@@ -10,8 +10,6 @@
libc_hidden_proto(vsnprintf)
-libc_hidden_proto(vfprintf)
-
#ifdef __UCLIBC_MJN3_ONLY__
#warning WISHLIST: Implement vsnprintf for non-buffered and no custom stream case.
#endif /* __UCLIBC_MJN3_ONLY__ */
@@ -61,7 +59,7 @@ int vsnprintf(char *__restrict buf, size_t size,
__STDIO_STREAM_DISABLE_GETC(&f);
__STDIO_STREAM_ENABLE_PUTC(&f);
- rv = vfprintf(&f, format, arg);
+ rv = _vfprintf_internal(&f, format, arg);
if (size) {
if (f.__bufpos == f.__bufend) {
--f.__bufpos;
@@ -203,7 +201,7 @@ int vsnprintf(char *__restrict buf, size_t size,
#endif
f.__nextopen = NULL;
- rv = vfprintf(&f, format, arg);
+ rv = _vfprintf_internal(&f, format, arg);
return rv;
}