On Fri, Oct 12, 2012 at 07:38:12PM +0200, Alexander Aring wrote: > Function add_image needs a allocated malloc space. > This is only available in the second getopt loop. > > Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx> Applied, thanks Sascha > --- > arch/sandbox/os/common.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c > index 0dedfe1..8c7679a 100644 > --- a/arch/sandbox/os/common.c > +++ b/arch/sandbox/os/common.c > @@ -311,11 +311,6 @@ int main(int argc, char *argv[]) > case 'i': > break; > case 'e': > - sprintf(str, "env%d", envno); > - ret = add_image(optarg, str); > - if (ret) > - exit(1); > - envno++; > break; > case 'O': > fd = open(optarg, O_WRONLY); > @@ -376,6 +371,13 @@ int main(int argc, char *argv[]) > exit(1); > fdno++; > break; > + case 'e': > + sprintf(str, "env%d", envno); > + ret = add_image(optarg, str); > + if (ret) > + exit(1); > + envno++; > + break; > default: > break; > } > -- > 1.7.12.2 > > > _______________________________________________ > barebox mailing list > barebox@xxxxxxxxxxxxxxxxxxx > http://lists.infradead.org/mailman/listinfo/barebox > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox