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
+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()
2001-08-17 Kevin L Mitchell <klmitch@mit.edu>
* ircd/numnicks.c: include stdlib.h for exit()
*mbuf++ = 'n';
if (chptr->mode.limit) {
*mbuf++ = 'l';
*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) {
}
if (*chptr->mode.key) {
}
} else if (MB_TYPE(mbuf, i) & MODE_LIMIT) {
/* if it's a limit, we also format the number */
}
} 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));
if (MB_TYPE(mbuf, i) & MODE_KEY) /* keep strings */
key = MB_STRING(mbuf, i);
else if (MB_TYPE(mbuf, i) & MODE_LIMIT)
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));
- 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--;
state->parc--;
state->max_args--;