This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] small fix for ar.c
- To: jes at linuxcare dot com
- Subject: Re: [patch] small fix for ar.c
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Thu, 10 Aug 2000 16:36:27 -0700
- CC: binutils at sourceware dot cygnus dot com
- References: <200008102141.RAA18775@plonk.linuxcare.com>
> Date: Thu, 10 Aug 2000 17:41:00 -0400
> From: Jes Sorensen <jes@linuxcare.com>
>
> Hi
>
> ar.c from current CVS crashes when called without arguments because it
> tries to do a strcmp on argv[1] which is NULL.
Oops!
Your patch is not quite right, though. We want to change the loop
to:
while (argc > 1 && strcmp (argv[1], "-X32_64") == 0)
{
argv++;
argc--;
}
otherwise a simple 'ar -X32_64' will still crash. Does that still
solve your problem?
> 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).
--
- Geoffrey Keating <geoffk@cygnus.com>