diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2010-06-17 11:45:14 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-06-17 11:45:14 -0700 |
commit | f23e586f898704626b4db5287a1c70cdfb11af5d (patch) | |
tree | eb69f222a5bcc14558a0b6ef9c4d072e4cead77d | |
parent | aa1050f66db73be1f61eea0c2df8169430d32d8e (diff) | |
parent | cc70d0fa55e35fabf250f4dccbaed2fa44f56da7 (diff) | |
download | syslinux-f23e586f898704626b4db5287a1c70cdfb11af5d.tar.gz |
Merge remote branch 'sha0/boot_args' into pathbased
-rw-r--r-- | com32/modules/ifcpu.c | 9 | ||||
-rw-r--r-- | com32/modules/ifcpu64.c | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/com32/modules/ifcpu.c b/com32/modules/ifcpu.c index 8a9a5f4f..1e57f088 100644 --- a/com32/modules/ifcpu.c +++ b/com32/modules/ifcpu.c @@ -71,20 +71,23 @@ static unsigned char sleep(unsigned int msec) /* XXX: this really should be librarized */ static void boot_args(char **args) { - int len = 0; + int len = 0, a = 0; char **pp; const char *p; char c, *q, *str; for (pp = args; *pp; pp++) - len += strlen(*pp); + len += strlen(*pp) + 1; - q = str = alloca(len + 1); + q = str = alloca(len); for (pp = args; *pp; pp++) { p = *pp; while ((c = *p++)) *q++ = c; + *q++ = ' '; + a = 1; } + q -= a; *q = '\0'; if (!str[0]) diff --git a/com32/modules/ifcpu64.c b/com32/modules/ifcpu64.c index 6d566a25..e123922e 100644 --- a/com32/modules/ifcpu64.c +++ b/com32/modules/ifcpu64.c @@ -73,20 +73,23 @@ static bool __constfunc cpu_has_feature(int x) /* XXX: this really should be librarized */ static void boot_args(char **args) { - int len = 0; + int len = 0, a = 0; char **pp; const char *p; char c, *q, *str; for (pp = args; *pp; pp++) - len += strlen(*pp); + len += strlen(*pp) + 1; - q = str = alloca(len + 1); + q = str = alloca(len); for (pp = args; *pp; pp++) { p = *pp; while ((c = *p++)) *q++ = c; + *q++ = ' '; + a = 1; } + q -= a; *q = '\0'; if (!str[0]) |