INN commit: branches/2.5/innd (art.c)

INN Commit rra at isc.org
Sun Jul 17 18:05:23 UTC 2011


    Date: Sunday, July 17, 2011 @ 11:05:23
  Author: iulius
Revision: 9249

Build INN with the new "-Wunused-but-set-variable" GCC 4.6.0 warning.

Remove unused "c" variable.

Well, better rewrite the function at the same time.
Thanks to Russ Allbery for the new array parsing code.

Modified:
  branches/2.5/innd/art.c

-------+
 art.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

Modified: art.c
===================================================================
--- art.c	2011-07-17 18:04:50 UTC (rev 9248)
+++ art.c	2011-07-17 18:05:23 UTC (rev 9249)
@@ -1554,18 +1554,17 @@
 
 /*
 **  Return true if a list of strings has a specific one.  This is a
-**  generic routine, but is used for seeing if a host is in the Path line.
+**  generic routine, but is used for seeing if a host is in the Path: line.
 */
 static bool
 ListHas(const char **list, const char *p)
 {
-  const char	*q;
-  char		c;
-
-  for (c = *p; (q = *list) != NULL; list++)
-    if (strcasecmp(p, q) == 0)
-      return true;
-  return false;
+    size_t i;
+     
+    for (i = 0; list[i] != NULL; i++)
+        if (strcasecmp(p, list[i]) == 0)
+            return true;
+    return false;
 }
 
 /*




More information about the inn-committers mailing list