1
0
Fork 0
mirror of https://github.com/ErikAndren/cue2pops-mac.git synced 2025-04-19 15:38:04 +02:00

Revert back to static 4 byte copy and add an assert protecting the runtime

This commit is contained in:
Erik Andrén Zachrisson 2015-11-01 13:48:27 +01:00
parent ce7be4c8db
commit efbffe16b4

View file

@ -1030,8 +1030,13 @@ int main(int argc, char **argv)
printf("daTrack_ptr LBA = %d (%Xh)\n\n", daTrack_ptr / SECTORSIZE, daTrack_ptr / SECTORSIZE);
}
memcpy(headerbuf + 1032, &sector_count, sizeof(sector_count)); // Sector Count (LEHEX)
memcpy(headerbuf + 1036, &sector_count, sizeof(sector_count)); // Sector Count (LEHEX)
if (sizeof(sector_count) != 4) {
printf("Error: sector_count variable is not 4 bytes. This will break the header generation.\n");
return 0;
}
memcpy(headerbuf + 1032, &sector_count, 4); // Sector Count (LEHEX)
memcpy(headerbuf + 1036, &sector_count, 4); // Sector Count (LEHEX)
headerbuf[1024] = 0x6B;
headerbuf[1025] = 0x48;