freemyipod r476 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r475‎ | r476 | r477 >
Date:03:02, 22 January 2011
Author:farthen
Status:new
Tags:
Comment:
emcore.py: file I/O: fix two obvious horrible bugs
Modified paths:
  • /emcore/trunk/tools/emcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcore.py
@@ -901,7 +901,7 @@
902902 storageinfo = self.emcore.storage_get_info(volume)
903903 while count > 0:
904904 sectors = min(count, int(buffsize / storageinfo.sectorsize))
905 - self.emcore.storage_read_sectors_md(volume, sector, sectors, buffsize, buffer)
 905+ self.emcore.storage_read_sectors_md(volume, sector, sectors, buffer, buffsize)
906906 f.write(self.emcore.read(buffer, storageinfo.sectorsize * sectors))
907907 sector = sector + sectors
908908 count = count - sectors
@@ -941,7 +941,7 @@
942942 if len(data) == 0: break
943943 while len(data) < bytes: data = data + f.read(bytes - len(data))
944944 self.emcore.write(buffer, data)
945 - self.emcore.storage_write_sectors_md(volume, sector, sectors, buffsize, buffer)
 945+ self.emcore.storage_write_sectors_md(volume, sector, sectors, buffer, buffsize)
946946 sector = sector + sectors
947947 count = count - sectors
948948 f.close()