freemyipod r633 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r632‎ | r633 | r634 >
Date:20:29, 20 February 2011
Author:theseven
Status:new
Tags:
Comment:
Installer for iPod Classic: Zero out sector buffers correctly
Modified paths:
  • /apps/installer-ipodclassic/main.c (modified) (history)

Diff [purge]

Index: apps/installer-ipodclassic/main.c
@@ -134,7 +134,7 @@
135135 uint32_t database = fatsectors + reserved;
136136 uint32_t clusoffset = 0;
137137 uint32_t* buf = memalign(0x10, 0x20000);
138 - memset(buf, 0, 0x800);
 138+ memset(buf, 0, 0x1000);
139139 memcpy(buf, "\xeb\x58\x00MSWIN5.0\0\x10", 0xd);
140140 ((uint8_t*)buf)[0xd] = secperclus;
141141 ((uint16_t*)buf)[7] = reserved;
@@ -150,7 +150,7 @@
151151 ((uint16_t*)buf)[0xff] = 0xaa55;
152152 if (rc = storage_write_sectors_md(0, 0, 1, buf))
153153 panicf(PANIC_KILLTHREAD, "Error writing MBR: %08X", rc);
154 - memset(buf, 0, 0x800);
 154+ memset(buf, 0, 0x1000);
155155 buf[0] = 0x41615252;
156156 buf[0x79] = 0x61417272;
157157 buf[0x7a] = clustercount - 1;