From: Geoffrey Keating Date: Fri, 11 Aug 2000 18:26:28 +0000 (+0000) Subject: * ar.c (main): Don't crash if called with no arguments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d720007042d05f12a6a42ec10154473f99dbfdb;p=binutils-gdb.git * ar.c (main): Don't crash if called with no arguments or only '-X32_64' as an argument. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index cd1f4d37ad1..a7aed1620a2 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2000-08-11 Geoff Keating + + * ar.c (main): Don't crash if called with no arguments + or only '-X32_64' as an argument. + 2000-08-05 Jason Eckhardt * readelf.c (elf/i860.h): Include. diff --git a/binutils/ar.c b/binutils/ar.c index d6401599a02..fe5709f56a4 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -437,7 +437,7 @@ main (argc, argv) of object files in the archive (the 64-bit objects or the 32-bit objects). GNU ar always looks at all kinds of objects in an archive. */ - while (strcmp (argv[1], "-X32_64") == 0) + while (argc > 1 && strcmp (argv[1], "-X32_64") == 0) { argv++; argc--;