ramfs: fix truncfile() for non multiple of extend size (64k)
The calculation of the last block size is wrong and we can only shrink the size of the last data block, not extend it.
This commit is contained in:
parent
692919521c
commit
51f4f46ae0
1 changed files with 2 additions and 1 deletions
|
@ -249,7 +249,8 @@ truncfile(File *f, vlong l)
|
|||
if(i < n){
|
||||
o = l % ESIZE;
|
||||
if(o != 0 && x->ent[i] != nil){
|
||||
x->ent[i]->size = o * sizeof(Ram*);
|
||||
if(o < x->ent[i]->size)
|
||||
x->ent[i]->size = o;
|
||||
i++;
|
||||
}
|
||||
while(i < n){
|
||||
|
|
Loading…
Reference in a new issue