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:
parent
c7036f1f5e
commit
aa12eda830
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user