Browse Source

SEEK END was off by one.

Godzil 1 year ago
parent
commit
b6f0880a98
1 changed files with 1 additions and 1 deletions
  1. 1 1
      miniffs.c

+ 1 - 1
miniffs.c

@@ -129,7 +129,7 @@ int miniffs_seek(file_t *file, size_t offset, int whence)
         file->offset += offset;
         break;
     case MFFS_SEEK_END:
-        file->offset = file->fent->size - offset;
+        file->offset = file->fent->size - 1 - offset;
         break;
     }
     miniffs_seterror(MINIFFS_NOERROR);