Formerly ../stdio/fseek.c.~20~
authorroland <roland>
Sun, 28 Jun 1992 23:00:58 +0000 (23:00 +0000)
committerroland <roland>
Sun, 28 Jun 1992 23:00:58 +0000 (23:00 +0000)
stdio/fseek.c

index 9fce3bb..47a7a17 100644 (file)
@@ -135,6 +135,13 @@ DEFUN(fseek, (stream, offset, whence),
       break;
     }
 
+  if (o < 0)
+    {
+      /* Negative file position is meaningless.  */
+      errno = EINVAL;
+      return -1;
+    }
+
   /* O is now an absolute position, the new target.  */
   stream->__target = o;