Return *some* error if we end up trying to seek before the beginning of

the file, so you don't get weird random errors.  EINVAL is as good as
anything.

svn path=/trunk/; revision=39896
This commit is contained in:
Guy Harris 2011-11-17 06:36:32 +00:00
parent eacdf1d46f
commit f3a88d4084
1 changed files with 1 additions and 1 deletions

View File

@ -982,7 +982,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err)
if (offset < 0) {
offset += file->pos;
if (offset < 0) { /* before start of file! */
/* *err = ???; */
*err = EINVAL;
return -1;
}
/* rewind, then skip to offset */