summaryrefslogtreecommitdiff
path: root/libc/stdio/scanf.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-02-27 21:33:59 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-02-27 21:33:59 +0000
commit82dd793fd07a21d4b03d3e0a1bd7434d302f35bb (patch)
treecc4df06c8e33aba7e0c221ef7bec66de123cd2cd /libc/stdio/scanf.c
parent8cdb05af7df2bca002024f3553ea69e462d97c24 (diff)
stdio mostly rewritten... passes lots of tests now.
printf now supports long double, plus some bug fixes.
Diffstat (limited to 'libc/stdio/scanf.c')
-rw-r--r--libc/stdio/scanf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c
index 2962125b4..5ed7f8366 100644
--- a/libc/stdio/scanf.c
+++ b/libc/stdio/scanf.c
@@ -35,15 +35,15 @@ va_dcl
#endif
{
FILE string[1] = {
- {0, (char *) (unsigned) -1, 0, 0, (char *) (unsigned) -1, -1,
- _IOFBF | __MODE_READ}
+ {0, (unsigned char *) ((unsigned) -1), 0, 0, (char *) ((unsigned) -1),
+ 0, -1, _IOFBF}
};
va_list ptr;
int rv;
- va_start(ptr, fmt);
string->bufpos = (unsigned char *) ((void *) sp);
+ va_start(ptr, fmt);
rv = vfscanf(string, fmt, ptr);
va_end(ptr);
return rv;
@@ -83,11 +83,11 @@ va_list ap;
int vsscanf(__const char *sp, __const char *fmt, va_list ap)
{
FILE string[1] = {
- {0, (char *) (unsigned) -1, 0, 0, (char *) (unsigned) -1, -1,
- _IOFBF | __MODE_READ}
+ {0, (unsigned char *) ((unsigned) -1), 0, 0, (char *) ((unsigned) -1),
+ 0, -1, _IOFBF}
};
- string->bufpos = (unsigned char *) ((void *) sp);
+ string->bufpos = (unsigned char *) sp;
return vfscanf(string, fmt, ap);
}
#endif