??? Hi, Recently it was brought to notice by Mr Steffen(snwint at suse.de) that ----> syslinux 4 comes with a C-rewrite of isohybrid. Unfortunately the option> parsing has changed: it no longer accepts hex numbers (0x...). Was this > intentional or can we have the old behaviour back (say, changing > sscanf(%u) -> sscanf(%i))? >I've made the changes to the current git repository and below is the patch(also attached) to fix this issue. Could you please have a look at it and sign off this change? ==diff --git a/utils/isohybrid.c b/utils/isohybrid.c index 7ee9a7f..8a60531 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -108,6 +108,7 @@ printh(void) ?int ?check_option(int argc, char *argv[]) ?{ +??? char *err = NULL; ???? int n = 0, ind = 0; ? ???? const char optstr[] = ":h:s:e:o:t:i:fcp?vV"; @@ -135,32 +136,38 @@ check_option(int argc, char *argv[]) ???????? switch (n) ???????? { ???????? case 'h': -??????????? if (!sscanf(optarg, "%hu", &head) || head < 1 || head > 256) +??????????? head = strtoul(optarg, &err, 0); +??????????? if (head < 1 || head > 256) ???????????????? errx(1, "invalid head: `%s', 1 <= head <= 256", optarg); ???????????? break; ? ???????? case 's': -??????????? if (!sscanf(optarg, "%hhu", §or) || sector < 1 || sector > 63) +??????????? sector = strtoul(optarg, &err, 0); +??????????? if (sector < 1 || sector > 63) ???????????????? errx(1, "invalid sector: `%s', 1 <= sector <= 63", optarg); ???????????? break; ? ???????? case 'e': -??????????? if (!sscanf(optarg, "%hhu", &entry) || entry < 1 || entry > 4) +??????????? entry = strtoul(optarg, &err, 0); +??????????? if (entry < 1 || entry > 4) ???????????????? errx(1, "invalid entry: `%s', 1 <= entry <= 4", optarg); ???????????? break; ? ???????? case 'o': -??????????? if (!sscanf(optarg, "%hhu", &offset) || offset > 64) +??????????? offset = strtoul(optarg, &err, 0); +??????????? if (*err || offset > 64) ???????????????? errx(1, "invalid offset: `%s', 0 <= offset <= 64", optarg); ???????????? break; ? ???????? case 't': -??????????? if (!sscanf(optarg, "%hu", &type) || type > 255) +??????????? type = strtoul(optarg, &err, 0); +??????????? if (*err || type > 255) ???????????????? errx(1, "invalid type: `%s', 0 <= type <= 255", optarg); ???????????? break; ? ???????? case 'i': -??????????? if (!sscanf(optarg, "%u", &id)) +??????????? id = strtoul(optarg, &err, 0); +??????????? if (*err) ???????????????? errx(1, "invalid id: `%s'", optarg); ???????????? break; ? diff --git a/utils/isohybrid.h b/utils/isohybrid.h index 826e90c..eecf1ca 100644 --- a/utils/isohybrid.h +++ b/utils/isohybrid.h @@ -20,7 +20,7 @@ ? * ? */ ? -#define VERSION???? "0.11" +#define VERSION???? "0.12" ?#define BUFSIZE???? 2048 ?#define MBRSIZE????? 432 == Thank you. --- Regards ?? -Prasad PS: Please don't send me html/attachment/Fwd mails -------------- next part -------------- A non-text attachment was scrubbed... Name: isohybrid-hex-option-parsing.patch Type: application/octet-stream Size: 2248 bytes Desc: not available URL: <http://www.zytor.com/pipermail/syslinux/attachments/20110612/10fd5649/attachment.obj>
Geert Stappers
2011-Jun-29 04:42 UTC
[syslinux] isohybrid.c patch: to support hex parameters
On Sun, Jun 12, 2011 at 12:45:45AM +0530, P J P wrote:> Hi, > > > Recently it was brought to notice by Mr Steffen(snwint at suse.de) that > > ---- > > syslinux 4 comes with a C-rewrite of isohybrid. Unfortunately the option > > > parsing has changed: it no longer accepts hex numbers (0x...). Was this > > intentional or can we have the old behaviour back (say, changing > > sscanf(%u) -> sscanf(%i))? > > > > I've made the changes to the current git repository and below is the patch(also attached) to fix this issue. > > Could you please have a look at it and sign off this change?For those not subscribed to syslinux-commits at zytor.com the patch is accepted HtH GSt
Maybe Matching Threads
- [PATCH] isohybrid: Generate MBR even when in EFI mode
- isolinux: Generate GPT and Mac bootable images
- Case sensitivity in :addresses in sieve vacation scripts
- Case sensitivity in :addresses in sieve vacation scripts
- [RFC/PATCH LGUEST X86_64 07/13] lguest64 loader