[syslinux] isohybrid patch 10

Geert Stappers stappers at stappers.nl
Wed May 12 10:43:07 PDT 2010


Op 20100511 om 02:14 schreef P J P:
>> --- On Tue, 11/5/10, Geert Stappers <stappers at stappers.nl> wrote:
>>> --- On Wed, 5/5/10, P J P <pj.pandit at yahoo.co.in> wrote:
>>> > Please see:
>>> > http://pjp.dgplug.org/tools/syslinux-3.86-isohybrid.patch.10
>>>
>>> Did you test this patch?
> ---                                                                       
> > Subject line now matches E-mail message body
> 
> Thanks. Did you test it? Just checking, for I thought you were going to test it?

isohybrid.pl prints usage when no paramaters are provided.
isohybrid should do the same. This patch achieves that.

diff --git a/utils/isohybrid.c b/utils/isohybrid.c
index 146ba69..e5a3fd8 100644
--- a/utils/isohybrid.c
+++ b/utils/isohybrid.c
@@ -70,16 +70,9 @@ uint8_t de_boot = 0, de_media = 0, de_sys = 0, de_mbz1 = 0;
 void
 usage(void)
 {
-    printf("Usage: %s [OPTIONS] <boot.iso>\n", prog);
-}
-
-
-void
-printh(void)
-{
 #define FMT "%-18s %s\n"
 
-    usage();
+    printf("Usage: %s [OPTIONS] <boot.iso>\n", prog);
 
     printf("\n");
     printf("Options:\n");
@@ -192,7 +185,7 @@ check_option(int argc, char *argv[])
             if (optopt)
                 errx(1, "invalid option `-%c', see --help", optopt);
 
-            printh();
+            usage();
             exit(0);
         }
     }


And I think this needs also be done

--- a/utils/isohybrid.c
+++ b/utils/isohybrid.c
@@ -331,7 +324,7 @@ initialise_mbr(uint8_t *mbr)
 
     extern unsigned char isohdpfx[][MBRSIZE];
 
-    memcpy(mbr, &isohdpfx[hd0 + 3 * partok], MBRSIZE);
+    memcpy(mbr, &isohdpfx[hd0 + 3 * partok][0], MBRSIZE);
     mbr += MBRSIZE;                                 /* offset 432 */
 
     tmp = lendian_int(de_lba * 4);


At least for readability.


Gegroet
Geert Stappers




More information about the Syslinux mailing list