From: batt Date: Fri, 14 Dec 2007 08:07:04 +0000 (+0000) Subject: Pastos. X-Git-Tag: 1.0.0~205 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=9b45c6171e04b1d312e1c221e0a575b9180157b0;p=bertos.git Pastos. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1037 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/fs/battfs.c b/fs/battfs.c index 0a01ee3c..8d02d94f 100644 --- a/fs/battfs.c +++ b/fs/battfs.c @@ -319,7 +319,7 @@ bool battfs_init(struct BattFsSuper *disk) { BattFsPageHeader hdr_old; - if (!battfs_readHeader(disk, page, &hdr_old)) + if (!battfs_readHeader(disk, disk->page_array[array_pos], &hdr_old)) return false; #ifdef _DEBUG @@ -359,7 +359,7 @@ bool battfs_init(struct BattFsSuper *disk) disk->page_array[array_pos] = new_page; /* Add free space */ - disk->free_bytes -= disk->page_size - sizeof(BattFsPageHeader) - old_fill; + disk->free_bytes += old_fill; /* Shift all array one position to the left, overwriting duplicate page */ array_pos -= hdr.pgoff;