]> jfr.im git - irc/quakenet/newserv.git/blobdiff - lib/irc_string.c
BUILD: add require-all build mode
[irc/quakenet/newserv.git] / lib / irc_string.c
index 0359b51b43a34230e312fccaeb704d274db8aa6f..56e6b7b85d06fd802b665567bdc73165ecd1c217 100644 (file)
@@ -122,7 +122,7 @@ int match2patterns(const char *patrn, const char *string) {
 /*  COPYRIGHT (C) 1986 Gary S. Brown.  You may use this program, or      */
 /*  code or tables extracted from it, as desired without restriction.    */
 /* Modified by Fox: no more length parameter, always does the whole string */
-unsigned long crc32(const char *s) {
+unsigned long irc_crc32(const char *s) {
   const char *cp;
   unsigned long crc32val;
   
@@ -134,7 +134,7 @@ unsigned long crc32(const char *s) {
 }
 
 /* Case insensitive version of the above */
-unsigned long crc32i(const char *s) {
+unsigned long irc_crc32i(const char *s) {
   const char *cp;
   unsigned long crc32val;
   
@@ -261,7 +261,7 @@ const char *longtoduration(unsigned long interval, int format) {
         pos += sprintf(outstring+pos,"%d minute%s ",minutes,minutes==1?"":"s");
       }
       if (seconds>0 || !interval) {
-        pos += sprintf(outstring+pos,"%d second%s ",seconds,seconds==1?"":"s");
+        sprintf(outstring+pos,"%d second%s ",seconds,seconds==1?"":"s");
       }
     }
   } else {
@@ -275,7 +275,7 @@ const char *longtoduration(unsigned long interval, int format) {
       pos += sprintf(outstring+pos, "%dm ",minutes);
     }
     if (seconds>0 || !interval) {
-      pos += sprintf(outstring+pos, "%ds ",seconds);
+      sprintf(outstring+pos, "%ds ",seconds);
     }
   }
 
@@ -523,9 +523,10 @@ break_while:
   if (!ch)
     return 0;                   /* mask ends with '*', we got it */
   ch = ToLower(ch);
-  while (ToLower(*s++) != ch)
+  do {
     if (!*s)
       return 1;
+  } while (ToLower(*s++) != ch);
   bs = s;                       /* Next try start from here */
 
   /* Check the rest of the "chunk" */