projects
/
libc-test
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
strtoul test fix, infrastructure changes
[libc-test]
/
src
/
stdio
/
fscanf.c
diff --git
a/src/stdio/fscanf.c
b/src/stdio/fscanf.c
index
1de09c3
..
d5da238
100644
(file)
--- a/
src/stdio/fscanf.c
+++ b/
src/stdio/fscanf.c
@@
-1,3
+1,4
@@
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@
-18,6
+19,18
@@
static void S(const char *s, const char *x, const char *m) {
error("got [%s], expected [%s] (%s)\n", s, x, m);
}
error("got [%s], expected [%s] (%s)\n", s, x, m);
}
+void test_scanf_long(void) {
+ enum {n = 1<<21};
+ char *s = malloc(n+1);
+ int i;
+ int r;
+
+ for (i = 0; i < n; i++) s[i] = '1';
+ s[n] = 0;
+ r = sscanf(s, "%d", &i);
+ free(s);
+}
+
void test_fscanf(void) {
int i, x, y;
char a[100], b[100];
void test_fscanf(void) {
int i, x, y;
char a[100], b[100];