This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [patch] small fix for ar.c


> 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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]