[U-Boot] 4xx warnings on cmd_elf.c

Kumar Gala galak at kernel.crashing.org
Fri Oct 31 15:30:50 CET 2008


So when I build a 4xx config I see:


cmd_elf.c: In function 'do_bootvx':
cmd_elf.c:173: warning: array subscript is below array bounds
cmd_elf.c:176: warning: array subscript is below array bounds
cmd_elf.c:181: warning: array subscript is below array bounds

                sprintf (build_buf, "ibmEmac(0,0)");

                if ((tmp = getenv ("hostname")) != NULL) {
                        sprintf (&build_buf[strlen (build_buf - 1)],
                                "host:%s ", tmp);
                } else {
                        sprintf (&build_buf[strlen (build_buf - 1)],
                                ": ");
                }

                if ((tmp = getenv ("ipaddr")) != NULL) {
                        sprintf (&build_buf[strlen (build_buf - 1)],
                                "e=%s ", tmp);
                }


these seem suspect.. should this be &build_buf[strlen(build_buf) - 1] ?

- k


More information about the U-Boot mailing list