src/heap.c (ulong_comparator): Fix for the case where "a" and "b" are
different by more than the (signed) range of the "int" type.
src/mod-helpserv.c (cmd_modstats): Fix a signed/unsigned warning.
src/proto-p10.c (reg_notice_func): Fix some cut-and-paste errors.
int
ulong_comparator(const void *a, const void *b)
{
- return (unsigned long)a-(unsigned long)b;
+ return (a < b) ? -1 : (a > b) ? 1 : 0;
}
return 0;
}
- if (mod < 0 && abs(mod) > field[week]) {
+ if (mod < 0 && mod < -(int)field[week]) {
helpserv_notice(user, "HSMSG_MODSTATS_NEGATIVE");
return 0;
}
if (numeric >= num_notice_funcs) {
int newnum = numeric + 8, ii;
notice_funcs = realloc(notice_funcs, newnum*sizeof(privmsg_func_t));
- for (ii = num_privmsg_funcs; ii < newnum; ++ii)
- privmsg_funcs[ii] = NULL;
+ for (ii = num_notice_funcs; ii < newnum; ++ii)
+ notice_funcs[ii] = NULL;
num_notice_funcs = newnum;
}
if (notice_funcs[numeric])