From d7bbca0ad83b83a7cd8d4f3d3ebb3ac0ff6c18c9 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 19 Oct 2008 07:06:49 +0000 Subject: [PATCH] Corrected a bug in make_isohybrid_mbr() --- xorriso/make_isohybrid_mbr.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/xorriso/make_isohybrid_mbr.c b/xorriso/make_isohybrid_mbr.c index 03185f2b..ae139fb8 100644 --- a/xorriso/make_isohybrid_mbr.c +++ b/xorriso/make_isohybrid_mbr.c @@ -108,7 +108,7 @@ int make_isohybrid_mbr(int bin_lba, int *img_blocks, char *mbr, int flag) 84: Gets size of image in bytes. 89: */ - imgsize= ((off_t) img_blocks) * (off_t) 2048; + imgsize= ((off_t) *img_blocks) * (off_t) 2048; /* 90: Computes $padding, size of padded image and number $c of @@ -158,12 +158,17 @@ int make_isohybrid_mbr(int bin_lba, int *img_blocks, char *mbr, int flag) gettimeofday(&tv, &tz); id= 0xffffffff & (tv.tv_sec ^ (tv.tv_usec * 2000)); +/* <<< for comparison with the perl script only + id= 1234567890; +*/ + /* 126: Adds 4 id bytes and 2 zero bytes. */ lsb_to_buf(&wpt, id, 32, 0); lsb_to_buf(&wpt, 0, 16, 0); + /* 129: Composes 16 byte record from the parameters determined 147: so far. Appends it to buffer and add 48 zero bytes. @@ -224,6 +229,21 @@ int main(int argc, char **argv) if(ret <= 0) exit(1); + +/* <<< for comparison with the perl script only +{ + FILE *fp; + + fp= fopen("/u/test/mbr_make_isohybrid_mbr", "w"); + if(fp == NULL) { + perror("make_isohybrid_mbr"); + exit(2); + } + fwrite(mbr, 512, 1, fp); + fclose(fp); +} +*/ + exit(0); }