From 5fbd9b519e082fc235a8a57c6cf761e6cefbfb62 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Sat, 22 Jun 2024 21:41:46 +0200 Subject: LibC: Fix bugs relating to fseek --- userland/libc/stdio/fseek.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'userland/libc/stdio/fseek.c') diff --git a/userland/libc/stdio/fseek.c b/userland/libc/stdio/fseek.c index fb891ec..cbccbb8 100644 --- a/userland/libc/stdio/fseek.c +++ b/userland/libc/stdio/fseek.c @@ -1,21 +1,8 @@ -#include #include +#include int fseek(FILE *stream, long offset, int whence) { - return stream->seek(stream, offset, whence); - /* - switch (whence) { - case SEEK_SET: - stream->offset_in_file = offset; - break; - case SEEK_CUR: - stream->offset_in_file += offset; - break; - case SEEK_END: - // FIXME - assert(0); - break; - } - // FIXME: Error checking - return 0;*/ + stream->read_buffer_stored = 0; + assert(stream->seek); + return stream->seek(stream, offset, whence); } -- cgit v1.2.3