Add typecast to avoid a warning from some buggy Gentoo version of gcc.
authorMichael Poole <mdpoole@troilus.org>
Sat, 31 Mar 2007 16:11:28 +0000 (12:11 -0400)
committerMichael Poole <mdpoole@troilus.org>
Sat, 31 Mar 2007 16:11:28 +0000 (12:11 -0400)
src/mod-blacklist.c (do_expandos): Typecast an expression that is
  supposed to have type size_t (which is unsigned) to unsigned.

src/mod-blacklist.c

index 7ae95260cced1326a9eea7244f3d13d807082508..c2d1e5eabc4f13acee579a57460a601ff08b0754 100644 (file)
@@ -68,7 +68,7 @@ do_expandos(char *output, unsigned int out_len, const char *input, ...)
         dlen = strlen(datum);
         for (found = output; (found = strstr(output, key)) != NULL; found += dlen) {
             rlen = strlen(found + klen);
-            if ((dlen > klen) && (found + dlen + rlen - output > out_len))
+            if ((dlen > klen) && ((unsigned)(found + dlen + rlen - output) > out_len))
                 rlen = output + out_len - found - dlen;
             memmove(found + dlen, found + klen, rlen);
             memcpy(found, datum, dlen + 1);