+2010-01-05 Colin Watson <cjwatson@ubuntu.com>
+
+ * util/mkisofs/write.c (padblock_write): Switch size and nmemb
+ arguments to fread so that we get a return value in bytes, rather
+ than something that will normally be rounded down to 0.
+ Adjust error handling to avoid producing garbage when size_t is not
+ the same size as long long.
+
2010-01-05 Colin Watson <cjwatson@ubuntu.com>
* util/mkisofs/write.c (padblock_write): Check return value of
if (! fp)
error (1, errno, _("Unable to open %s"), boot_image_embed);
- if (fread (buffer, 2048 * PADBLOCK_SIZE, 1, fp) == 0)
- error (1, errno, _("cannot read %llu bytes from %s"),
- (size_t) (2048 * PADBLOCK_SIZE), boot_image_embed);
+ if (fread (buffer, 1, 2048 * PADBLOCK_SIZE, fp) == 0)
+ error (1, errno, _("cannot read %d bytes from %s"),
+ 2048 * PADBLOCK_SIZE, boot_image_embed);
if (fgetc (fp) != EOF)
error (1, 0, _("%s is too big for embed area"), boot_image_embed);
}