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

Andrew J. Schorr aschorr at telemetry-investments.com
Tue Feb 27 14:36:28 GMT 2007


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?

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



More information about the Quagga-dev mailing list