PERFORCE change 30881 for review
    Peter Wemm 
    peter at FreeBSD.org
       
    Fri May  9 14:48:15 PDT 2003
    
    
  
http://perforce.freebsd.org/chv.cgi?CH=30881
Change 30881 by peter at peter_hammer on 2003/05/09 14:47:36
	make ppp compile (avoid ICE in gcc-3.2.2) by trivially changing
	the algorithm to something equivalent.
Affected files ...
.. //depot/projects/hammer/usr.sbin/ppp/ncpaddr.c#5 edit
Differences ...
==== //depot/projects/hammer/usr.sbin/ppp/ncpaddr.c#5 (text+ko) ====
@@ -142,16 +142,16 @@
 {
   const u_char masks[] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe };
   const u_char *c, *p, *end;
-  int masklen;
+  int masklen, m;
 
   p = (const u_char *)mask;
   for (masklen = 0, end = p + 16; p < end && *p == 0xff; p++)
     masklen += 8;
 
   if (p < end) {
-    for (c = masks; c < masks + sizeof masks; c++)
+    for (c = masks, m = 0; c < masks + sizeof masks; c++, m++)
       if (*c == *p) {
-        masklen += c - masks;
+        masklen += m;
         break;
       }
   }
    
    
More information about the p4-projects
mailing list