the seek function takes a fpos_t (off_t), not a long
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 22 Jun 1992 06:52:07 +0000 (22:52 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 22 Jun 1992 06:52:07 +0000 (22:52 -0800)
SCCS-vsn: lib/libc/stdio/fseek.c 5.8

usr/src/lib/libc/stdio/fseek.c

index 66d444e..7070c75 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fseek.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)fseek.c    5.8 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -134,7 +134,7 @@ fseek(fp, offset, whence)
                if (fp->_flags & __SOFF)
                        curoff = fp->_offset;
                else {
                if (fp->_flags & __SOFF)
                        curoff = fp->_offset;
                else {
-                       curoff = (*seekfn)(fp->_cookie, 0L, SEEK_CUR);
+                       curoff = (*seekfn)(fp->_cookie, (fpos_t)0, SEEK_CUR);
                        if (curoff == POS_ERR)
                                goto dumb;
                }
                        if (curoff == POS_ERR)
                                goto dumb;
                }
@@ -207,7 +207,7 @@ fseek(fp, offset, whence)
         */
 dumb:
        if (__sflush(fp) ||
         */
 dumb:
        if (__sflush(fp) ||
-           (*seekfn)(fp->_cookie, offset, whence) == POS_ERR) {
+           (*seekfn)(fp->_cookie, (fpos_t)offset, whence) == POS_ERR) {
                return (EOF);
        }
        /* success: clear EOF indicator and discard ungetc() data */
                return (EOF);
        }
        /* success: clear EOF indicator and discard ungetc() data */