diff options
Diffstat (limited to 'src/stdio/fseek.c')
-rw-r--r-- | src/stdio/fseek.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/stdio/fseek.c b/src/stdio/fseek.c index e1c6db57..47388c9a 100644 --- a/src/stdio/fseek.c +++ b/src/stdio/fseek.c @@ -6,8 +6,15 @@ int fseek(FILE *stream, long int offset, int whence) { SIGNAL_SAFE(0); - - (void)stream; (void)offset; + ASSERT_STREAM(stream, 0, 0); + + if (stream->text && offset != 0) { + if (whence != SEEK_SET) { + UNDEFINED("In call to fseek(): Only SEEK_SET is supported for text files"); + } + /* if offset is not previous */ + /* UNDEFINED("fseek() on text files requires an offset previously returned by ftell()"); */ + } if (whence == SEEK_CUR) { } else if (whence == SEEK_END) { |