diff --git a/tests/Makefile b/tests/Makefile index bc6123d676..c6958733d2 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -44,6 +44,7 @@ EXPECT_NAMES=\ stdio/printf_space_pad \ stdio/ungetc_multiple \ stdio/ungetc_ftell \ + stdio/fscanf_offby1 \ stdlib/a64l \ stdlib/alloc \ stdlib/atof \ diff --git a/tests/expected/stdio/fscanf_offby1.stderr b/tests/expected/stdio/fscanf_offby1.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/stdio/fscanf_offby1.stdout b/tests/expected/stdio/fscanf_offby1.stdout new file mode 100644 index 0000000000..daf724a9e5 --- /dev/null +++ b/tests/expected/stdio/fscanf_offby1.stdout @@ -0,0 +1 @@ +1234, 7, 32 diff --git a/tests/stdio/fscanf_offby1.c b/tests/stdio/fscanf_offby1.c new file mode 100644 index 0000000000..c833935793 --- /dev/null +++ b/tests/stdio/fscanf_offby1.c @@ -0,0 +1,8 @@ +//1234 a +#include +int main() { + FILE *f = fopen("stdio/fscanf_offby1.c", "r"); + int x; + fscanf(f, "//%d", &x); + printf("%d, %ld, %d\n", x, ftell(f), fgetc(f)); +}