summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@geoffk.org>2000-08-11 18:26:28 +0000
committerGeoffrey Keating <geoffk@geoffk.org>2000-08-11 18:26:28 +0000
commit0c994f9b22a061db30c2062f2843eaea48e39807 (patch)
treea32ca35b44490c21cca340a043be53fef2978a39
parentdc5a51a5a2234eb2b8207715b2c829c5e5190c6f (diff)
downloadbinutils-redhat-0c994f9b22a061db30c2062f2843eaea48e39807.tar.gz
* ar.c (main): Don't crash if called with no arguments
or only '-X32_64' as an argument.
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/ar.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index cd1f4d37ad..a7aed1620a 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-11 Geoff Keating <geoffk@cygnus.com>
+
+ * ar.c (main): Don't crash if called with no arguments
+ or only '-X32_64' as an argument.
+
2000-08-05 Jason Eckhardt <jle@cygnus.com>
* readelf.c (elf/i860.h): Include.
diff --git a/binutils/ar.c b/binutils/ar.c
index d6401599a0..fe5709f56a 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--;