[patch] small fix for ar.c
Jes Sorensen
jes@linuxcare.com
Thu Aug 10 14:40:00 GMT 2000
Hi
ar.c from current CVS crashes when called without arguments because it
tries to do a strcmp on argv[1] which is NULL.
Jes
2000-08-10 Jes Sorensen <jes@linuxcare.com>
* ar.c (main): Only check for the -X32_64 option in argv[1+] if
argc > 1 (strcmp does not like null pointers).
--- ar.c.old Thu Aug 10 23:37:11 2000
+++ ar.c Thu Aug 10 18:22:34 2000
@@ -437,10 +437,13 @@
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)
+ if (argc > 1)
{
- argv++;
- argc--;
+ while (strcmp (argv[1], "-X32_64") == 0)
+ {
+ argv++;
+ argc--;
+ }
}
if (is_ranlib)
More information about the Binutils
mailing list