[quagga-dev 4594] Re: Bug: comparison with string literal

Paul Jakma paul at clubi.ie
Tue Feb 27 15:21:08 GMT 2007


On Tue, 27 Feb 2007, Andrew J. Schorr wrote:

> On Tue, Dec 19, 2006 at 02:52:22PM +0100, Pavol Rusnak wrote:
>> Hi!
>> One of our reporters sent us this report:
>>
>> ospf6_lsa.c:720: warning: comparison with string literal
>>
>> I'm attaching a patch.
>
> Any reason not to accept this patch?

ACK from me. Sorry, missed it.

> Regards,
> Andy
>
> Index: ospf6d/ospf6_lsa.c
> ===================================================================
> RCS file: /var/cvsroot/quagga/ospf6d/ospf6_lsa.c,v
> retrieving revision 1.15
> diff -b -u -p -r1.15 ospf6_lsa.c
> --- ospf6d/ospf6_lsa.c	14 Mar 2005 20:19:02 -0000	1.15
> +++ ospf6d/ospf6_lsa.c	27 Feb 2007 14:34:59 -0000
> @@ -717,7 +717,7 @@ ospf6_lsa_handler_name (struct ospf6_lsa
>   unsigned int i;
>   unsigned int size = strlen (h->name);
>
> -  if (h->name == "Unknown" &&
> +  if (!strcmp(h->name, "Unknown") &&
>       h->type != OSPF6_LSTYPE_UNKNOWN)
>     {
>       snprintf (buf, sizeof (buf), "%#04hx", h->type);
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev at lists.quagga.net
> http://lists.quagga.net/mailman/listinfo/quagga-dev
>

-- 
Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Fortune:
Any man who hates dogs and babies can't be all bad.
 		-- Leo Rosten, on W.C. Fields



More information about the Quagga-dev mailing list