summaryrefslogtreecommitdiff
path: root/firmware/common
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-05-27 12:38:41 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-05-27 12:38:41 +0000
commitaa12eda830f688659b93ab0acf6f9d68a626eff6 (patch)
treeee67d483e8c2d17fe9e83e298ed19aaee9e8137f /firmware/common
parentc7036f1f5e494bbcec8daf5da65bb00668b5754f (diff)
Bugfix: SEEK_END takes negative position
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@747 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 4b7865d724..38ae3cb912 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -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;
}