Files
RedBear-OS/tests/stdio/fseek.c
T
Tibor Nagy d1a424c002 tests: Replace returns with exits in the main functions
This will allow us to redefine the exit function.

For example:
```
#define exit(code) { \
    fprintf(stderr, "%s:%d: exit(%s) in function ‘%s’\n",
        __FILE__, __LINE__, #code, __func__); \
    _exit(code); \
}
```
2019-02-21 12:15:06 +01:00

14 lines
303 B
C

#include <stdio.h>
#include <stdlib.h>
int main(void) {
FILE *f = fopen("stdio/stdio.in", "r");
if (fseek(f, 14, SEEK_CUR) < 0) {
puts("fseek error");
exit(EXIT_FAILURE);
}
char buffer[256];
printf("%s", fgets(buffer, 256, f));
printf("ftell: %ld\n", ftello(f));
}