wok rev 3870

syslinux/ifmem: fix cmdline
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Aug 08 17:08:44 2009 +0200 (2009-08-08)
parents a583621eb383
children 8cdc8f3e6e3e
files syslinux/stuff/extra/ifmem.c
line diff
     1.1 --- a/syslinux/stuff/extra/ifmem.c	Sat Aug 08 16:33:21 2009 +0200
     1.2 +++ b/syslinux/stuff/extra/ifmem.c	Sat Aug 08 17:08:44 2009 +0200
     1.3 @@ -54,7 +54,7 @@
     1.4  int main(int argc, char *argv[])
     1.5  {
     1.6    char *s;
     1.7 -  int i, j;
     1.8 +  int i, j = 1;
     1.9  
    1.10    for (s = argv[1]; *s && (*s < '0' || *s > '9'); s++);
    1.11  
    1.12 @@ -74,9 +74,9 @@
    1.13    // find and copy extra parameters to command line
    1.14    // assume the command line ends with two words (not number)
    1.15    for (s = argv[i++]; i < argc; i++) { 
    1.16 -	char c = argv[i];
    1.17 +	char c = *argv[i];
    1.18  	if (c >= '0' && c <= '9') j = i;
    1.19 -	if (i - j > 2 && ++i < argc) {
    1.20 +	if (i - j > 2 && i < argc) {
    1.21  #define SZ 512
    1.22  		static char cmdline[SZ];
    1.23  		char *p = cmdline, *q = s;