ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/match.c
(Generate patch)

Comparing ircd-hybrid-8/src/match.c (file contents):
Revision 1474 by michael, Sun Jul 22 14:44:07 2012 UTC vs.
Revision 1530 by michael, Tue Sep 18 11:31:02 2012 UTC

# Line 253 | Line 253 | irccmp(const char *s1, const char *s2)
253    assert(s1 != NULL);
254    assert(s2 != NULL);
255    
256 <  while (ToUpper(*str1) == ToUpper(*str2))
257 <  {
256 >  for (; ToUpper(*str1) == ToUpper(*str2); ++str1, ++str2)
257      if (*str1 == '\0')
258        return 0;
259  
261    ++str1;
262    ++str2;
263  }
264
260    return 1;
261   }
262  
# Line 273 | Line 268 | ircncmp(const char *s1, const char *s2,
268  
269    assert(s1 != NULL);
270    assert(s2 != NULL);
271 +  assert(n > 0);
272  
273    if (n == 0)
274      return 0;
275  
276 <  while (ToUpper(*str1) == ToUpper(*str2))
277 <  {
282 <    if (*str1 == '\0')
276 >  for (; ToUpper(*str1) == ToUpper(*str2); ++str1, ++str2)
277 >    if (--n == 0 || *str1 == '\0')
278        return 0;
279  
285    ++str1;
286    ++str2;
287  }
288
280    return 1;
281   }
282  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)