Bugfix: SEEK_END takes negative position

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@747 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-05-27 12:38:41 +00:00
parent c7036f1f5e
commit aa12eda830

View File

@ -227,15 +227,14 @@ int lseek(int fd, int offset, int whence)
break;
case SEEK_END:
pos = openfiles[fd].size - offset;
pos = openfiles[fd].size + offset;
break;
default:
errno = EINVAL;
return -1;
}
if ( (pos < 0) ||
(pos > openfiles[fd].size) ) {
if ((pos < 0) || (pos > openfiles[fd].size)) {
errno = EINVAL;
return -1;
}