Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Fri, 31 Aug 2001 14:37:30 +0000 (14:37 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Fri, 31 Aug 2001 14:37:30 +0000 (14:37 +0000)
Log message:

Channel limits are unsigned; display and process them that way.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@555 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/channel.c

index 28f642e1b1b4d2636a4980f5dfdac8a43e2aea6f..32423876f512793b9e4a86a15d47fb96a3d6f08e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-08-31  Kevin L Mitchell  <klmitch@mit.edu>
+
+       * ircd/channel.c: use "%u" to format limit arguments; use
+       strtoul() to process limit arguments in a /mode command--note:
+       most clients seem to truncate the integer, probably because
+       they're using atoi, and perhaps signed ints
+
 2001-08-17  Kevin L Mitchell  <klmitch@mit.edu>
 
        * ircd/numnicks.c: include stdlib.h for exit()
index c209148050d301a1dd5d3373bb18ff3360edb95a..c9cf899adf692b6ae6221c155526449f336c5a23 100644 (file)
@@ -691,7 +691,7 @@ void channel_modes(struct Client *cptr, char *mbuf, char *pbuf,
     *mbuf++ = 'n';
   if (chptr->mode.limit) {
     *mbuf++ = 'l';
-    ircd_snprintf(0, pbuf, sizeof(pbuf), "%d", chptr->mode.limit);
+    ircd_snprintf(0, pbuf, sizeof(pbuf), "%u", chptr->mode.limit);
   }
 
   if (*chptr->mode.key) {
@@ -1408,7 +1408,7 @@ modebuf_flush_int(struct ModeBuf *mbuf, int all)
       }
     } else if (MB_TYPE(mbuf, i) & MODE_LIMIT) {
       /* if it's a limit, we also format the number */
-      ircd_snprintf(0, limitbuf, sizeof(limitbuf), "%d", MB_UINT(mbuf, i));
+      ircd_snprintf(0, limitbuf, sizeof(limitbuf), "%u", MB_UINT(mbuf, i));
 
       tmp = strlen(limitbuf);
 
@@ -1810,7 +1810,7 @@ modebuf_extract(struct ModeBuf *mbuf, char *buf)
       if (MB_TYPE(mbuf, i) & MODE_KEY) /* keep strings */
        key = MB_STRING(mbuf, i);
       else if (MB_TYPE(mbuf, i) & MODE_LIMIT)
-       ircd_snprintf(0, limitbuf, sizeof(limitbuf), "%d", MB_UINT(mbuf, i));
+       ircd_snprintf(0, limitbuf, sizeof(limitbuf), "%u", MB_UINT(mbuf, i));
     }
   }
 
@@ -1920,7 +1920,7 @@ mode_parse_limit(struct ParseState *state, int *flag_p)
       return;
     }
 
-    t_limit = atoi(state->parv[state->args_used++]); /* grab arg */
+    t_limit = strtoul(state->parv[state->args_used++], 0, 10); /* grab arg */
     state->parc--;
     state->max_args--;