summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2010-01-20 00:53:03 +0000
committerXin LI <delphij@FreeBSD.org>2010-01-20 00:53:03 +0000
commitbf2d481d44256937ba57787654ae1f8097276525 (patch)
tree4d014255f3a93c6e0d042356b2cf7f00b4781fbd /lib/libc/stdio
parent49399ca706df781a3317bbf9b002f236b8012061 (diff)
Notes
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/sscanf.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index 3c792e054ba5..c793b86699cc 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -41,37 +41,14 @@ __FBSDID("$FreeBSD$");
#include <stdarg.h>
#include "local.h"
-static int eofread(void *, char *, int);
-
-/* ARGSUSED */
-static int
-eofread(cookie, buf, len)
- void *cookie;
- char *buf;
- int len;
-{
-
- return (0);
-}
-
int
sscanf(const char * __restrict str, char const * __restrict fmt, ...)
{
int ret;
va_list ap;
- FILE f;
- f._file = -1;
- f._flags = __SRD;
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._r = strlen(str);
- f._read = eofread;
- f._ub._base = NULL;
- f._lb._base = NULL;
- f._orientation = 0;
- memset(&f._mbstate, 0, sizeof(mbstate_t));
va_start(ap, fmt);
- ret = __svfscanf(&f, fmt, ap);
+ ret = vsscanf(str, fmt, ap);
va_end(ap);
return (ret);
}