Fix lseek's bug in smartfs
authorTaeJun Kwon <tj80.kwon@samsung.com>
Mon, 3 Apr 2017 08:11:11 +0000 (17:11 +0900)
committerTaeJun Kwon <tj80.kwon@samsung.com>
Mon, 3 Apr 2017 08:11:11 +0000 (17:11 +0900)
lseek should set the file offset to the size of the file plus offset

os/fs/smartfs/smartfs_smart.c

index ca555bd..a42686c 100644 (file)
@@ -1040,7 +1040,7 @@ static off_t smartfs_seek_internal(struct smartfs_mountpt_s *fs, struct smartfs_
                break;
 
        case SEEK_END:
-               newpos = sf->entry.datlen - offset;
+               newpos = sf->entry.datlen + offset;
                break;
        }