From 8b3f2fa09e9241e20926c8171753a271c21ec93d Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 2 Feb 2024 13:56:33 -0500 Subject: first cut of tracking previous return values with ftell()/fseek() as POC --- src/stdio/fseek.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/stdio/fseek.c') diff --git a/src/stdio/fseek.c b/src/stdio/fseek.c index 47388c9a..9f4bd733 100644 --- a/src/stdio/fseek.c +++ b/src/stdio/fseek.c @@ -12,8 +12,7 @@ int fseek(FILE *stream, long int offset, int whence) 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()"); */ + ASSERT_PREV(offset, stream->valid_ftell, stream->nvalid_ftell, "ftell"); } if (whence == SEEK_CUR) { -- cgit v1.2.1