diff options
author | Jakob Kaivo <jkk@ung.org> | 2024-02-02 13:25:45 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2024-02-02 13:25:45 -0500 |
commit | 24f39222098253da4ad1a9cd8ddef5b9b0152ba1 (patch) | |
tree | 36eede312e7dcb4a9afe49342fba996ef273549d /src/stdio/fseek.c | |
parent | 6aebe0dbfc24f0af73eb422b4748a9b35df5b435 (diff) |
use UNDEFINED() instead of directly calling __undefined()
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) { |