+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()
*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) {
}
} 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);
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));
}
}
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--;