#include <wctype.h>
#include <limits.h>
#include <string.h>
-#include <errno.h>
-#include <math.h>
-#include <float.h>
-#include <inttypes.h>
+#include <stdint.h>
#include "stdio_impl.h"
#include "shgetc.h"
{
int width;
int size;
- int alloc;
+ int alloc = 0;
int base;
const unsigned char *p;
int c, t;
FLOCK(f);
+ if (!f->rpos) __toread(f);
+ if (!f->rpos) goto input_fail;
+
for (p=(const unsigned char *)fmt; *p; p++) {
alloc = 0;
continue;
}
if (*p != '%' || p[1] == '%') {
- p += *p=='%';
shlim(f, 0);
- c = shgetc(f);
+ if (*p == '%') {
+ p++;
+ while (isspace((c=shgetc(f))));
+ } else {
+ c = shgetc(f);
+ }
if (c!=*p) {
shunget(f);
if (c<0) goto input_fail;
goto match_fail;
}
- pos++;
+ pos += shcnt(f);
continue;
}
}
if (*p=='m') {
+ wcs = 0;
+ s = 0;
alloc = !!dest;
p++;
} else {
FUNLOCK(f);
return matches;
}
+
+weak_alias(vfscanf,__isoc99_vfscanf);