void (*irc_send)(struct userNode *from, const char *to, const char *msg);
static struct string_buffer input;
unsigned int size, ipos, pos, length, chars_sent, use_color;
- unsigned int expand_pos, expand_ipos, newline_ipos;
+ unsigned int expand_ipos, newline_ipos;
char line[MAX_LINE_SIZE];
struct service *service;
static char* trigger = NULL;
* that requires a very big intermediate buffer.
*/
expand_ipos = newline_ipos = ipos = 0;
- expand_pos = pos = 0;
+ pos = 0;
chars_sent = 0;
while (input.list[ipos]) {
char ch, *value = NULL, *free_value;
free(free_value);
pos += length;
if ((pos < size-1) && input.list[ipos]) {
- expand_pos = pos;
expand_ipos = ipos;
continue;
}
send_line:
- expand_pos = pos;
expand_ipos = ipos;
SEND_LINE(0);
#undef SEND_LINE
{
static char mask[HOSTLEN + 1];
char *parv[HOSTLEN + 1], *parv2[HOSTLEN + 1], s[HOSTLEN + 1], s2[HOSTLEN + 2];
- int parc = 0, parc2 = 0, len = 0;
+ int parc2 = 0, len = 0;
unsigned int hash[8];
if ((strlen(host) < 3) || (strlen(curr) < 3))
strncpy (s, curr, HOSTLEN);
strncpy (s2, host, HOSTLEN);
- parc = str2arr (parv, s, ".");
parc2 = str2arr (parv2, s2, ".");
check_keys();
{
static char mask[HOSTLEN + 1];
char *parv[HOSTLEN + 1], *parv2[HOSTLEN + 1], s[HOSTLEN + 1], s2[HOSTLEN + 2];
- int parc = 0, parc2 = 0, len = 0;
+ int parc2 = 0, len = 0;
unsigned int hash[8];
if ((strlen(host) < 3) || (strlen(curr) < 3))
strncpy (s, curr, HOSTLEN);
strncpy (s2, host, HOSTLEN);
- parc = str2arr (parv, s, ".");
parc2 = str2arr (parv2, s2, ".");
check_keys();
static char mask[HOSTLEN + 1];
char *parv[HOSTLEN + 1], *parv2[HOSTLEN + 1], s[HOSTLEN + 1],
s2[HOSTLEN + 2], s3[HOSTLEN + 2];
- int parc = 0, parc2 = 0;
+ int parc2 = 0;
unsigned int hash[8];
if ((strlen(host) < 3) || (strlen(curr) < 3))
ip62arr (s, s3);
- parc = str2arr (parv, s3, ":");
parc2 = str2arr (parv2, s2, ".");
check_keys();
static void
ioset_buffered_read(struct io_fd *fd) {
- int put_avail, nbr, fdnum;
+ int put_avail, nbr;
if (!(put_avail = ioq_put_avail(&fd->recv)))
put_avail = ioq_grow(&fd->recv);
fd->recv.put += nbr;
if (fd->recv.put == fd->recv.size)
fd->recv.put = 0;
- fdnum = fd->fd;
while (fd->line_len > 0) {
struct io_fd *old_active;
int died = 0;
unsigned int matched = 0;
if (discrim->type) {
- static volatile struct logEntry *last;
struct logEntry *entry;
- for (entry = discrim->type->log_oldest, last = NULL;
+ for (entry = discrim->type->log_oldest;
entry;
- last = entry, entry = entry->next) {
+ entry = entry->next) {
verify(entry);
if (entry_match(discrim, entry)) {
esf(entry, data);
char* mynuh;
char* mynick;
char* myacc;
- char* mynuhtemp;
char* mycommand;
char* myrest;
char* datestr;
mynuh = (char *) mysep(&LogLine, " ");
else {
mynick = (char *) mysep(&LogLine, "!");
- mynuhtemp = (char *) mysep(&LogLine, "@");
- mynuhtemp = (char *) mysep(&LogLine, ":");
+ mysep(&LogLine, "@");
+ mysep(&LogLine, ":");
myacc = (char *) mysep(&LogLine, " ");
sprintf(mynuhbuf, "%s:%s", mynick, myacc);
mynuh = mynuhbuf;
enum notification_type notify;
/* This is a default; it can be changed on a per-request basis */
- enum persistence_type persist_types[PERSIST_T_COUNT];
+ enum persistence_length persist_types[PERSIST_T_COUNT];
dict_t users; /* indexed by handle */
}
static int cmd_add_user(struct helpserv_bot *hs, int from_opserv, struct userNode *user, enum helpserv_level level, int argc, char *argv[]) {
- struct helpserv_user *actor, *new_user;
+ struct helpserv_user *actor;
struct handle_info *handle;
REQUIRE_PARMS(2);
return 0;
}
- new_user = helpserv_add_user(hs, handle, level);
+ helpserv_add_user(hs, handle, level);
helpserv_notice(user, "HSMSG_ADDED_USER", helpserv_level2str(level), handle->handle);
return 1;
add_memo(time_t sent, struct memo_account *recipient, struct memo_account *sender, char *message, int nfrom_read)
{
struct memo *memo;
- struct history *history;
memo = calloc(1, sizeof(*memo));
if (!memo)
memoCount++;
if (nfrom_read)
- history = add_history(sent, recipient, sender, memo->id);
+ add_history(sent, recipient, sender, memo->id);
return memo;
}
{
char *str;
struct handle_info *sender, *recipient;
- struct history *history;
unsigned long id;
time_t sent;
return 0;
}
- history = add_history(sent, memoserv_get_account(recipient), memoserv_get_account(sender), id);
+ add_history(sent, memoserv_get_account(recipient), memoserv_get_account(sender), id);
return 0;
}
continue;
} else if (isdigit(argv[arg][1])) {
char *end_num;
- unsigned long tmp;
- tmp = strtoul(argv[arg]+1, &end_num, 10);
+ strtoul(argv[arg]+1, &end_num, 10);
switch (end_num[0]) {
case 0:
continue;
}
static void
-opserv_tempshun(struct userNode *target, char *src_handle, char *reason)
+opserv_tempshun(struct userNode *target, UNUSED_ARG(char *src_handle), char *reason)
{
irc_tempshun(opserv, target, 0, reason);
}
if(!svccmd_can_invoke(user, cmd->parent->bot, shun_cmd, channel, SVCCMD_NOISY))
return 0;
}
- reason = (argc > 2) ? unsplit_string(argv+2, argc-2, NULL) : NULL;
+ reason = (argc > offset) ? unsplit_string(argv+offset, argc-offset, NULL) : NULL;
shun = opserv_shun(target, user->handle_info->handle, reason, duration);
reply("OSMSG_SHUN_ISSUED", shun->target);
return 1;
matches++;
break;
case 'O':
- if(IsOper(user) != 0 != negate) matches++;
+ if((IsOper(user) != 0) != negate) matches++;
break;
case 'o':
- if(IsOper(user) != 0 != negate) matches++;
+ if((IsOper(user) != 0) != negate) matches++;
break;
case 'i':
- if(IsInvisible(user) != 0 != negate) matches++;
+ if((IsInvisible(user) != 0) != negate) matches++;
break;
case 'w':
- if(IsWallOp(user) != 0 != negate) matches++;
+ if((IsWallOp(user) != 0) != negate) matches++;
break;
case 'd':
- if(IsDeaf(user) != 0 != negate) matches++;
+ if((IsDeaf(user) != 0) != negate) matches++;
break;
case 'k':
- if(IsService(user) != 0 != negate) matches++;
+ if((IsService(user) != 0) != negate) matches++;
break;
case 'g':
- if(IsGlobal(user) != 0 != negate) matches++;
+ if((IsGlobal(user) != 0) != negate) matches++;
break;
case 'h':
- if(IsSetHost(user) != 0 != negate) matches++;
+ if((IsSetHost(user) != 0) != negate) matches++;
break;
case 'B':
- if(IsBotM(user) != 0 != negate) matches++;
+ if((IsBotM(user) != 0) != negate) matches++;
break;
case 'p':
case 'n':
- if(IsHideChans(user) != 0 != negate) matches++;
+ if((IsHideChans(user) != 0) != negate) matches++;
break;
case 'I':
- if(IsHideIdle(user) != 0 != negate) matches++;
+ if((IsHideIdle(user) != 0) != negate) matches++;
break;
case 'X':
- if(IsXtraOp(user) != 0 != negate) matches++;
+ if((IsXtraOp(user) != 0) != negate) matches++;
break;
case 'x':
- if(IsHiddenHost(user) != 0 != negate) matches++;
+ if((IsHiddenHost(user) != 0) != negate) matches++;
break;
case 'a':
- if(IsAdmin(user) != 0 != negate) matches++;
+ if((IsAdmin(user) != 0) != negate) matches++;
break;
case 'z':
- if(IsSSL(user) != 0 != negate) matches++;
+ if((IsSSL(user) != 0) != negate) matches++;
break;
case 'D':
- if(IsPrivDeaf(user) != 0 != negate) matches++;
+ if((IsPrivDeaf(user) != 0) != negate) matches++;
break;
case 'R':
- if(IsAccountOnly(user) != 0 != negate) matches++;
+ if((IsAccountOnly(user) != 0) != negate) matches++;
break;
case 'W':
- if(IsWhoisNotice(user) != 0 != negate) matches++;
+ if((IsWhoisNotice(user) != 0) != negate) matches++;
break;
case 'H':
- if(IsHideOper(user) != 0 != negate) matches++;
+ if((IsHideOper(user) != 0) != negate) matches++;
break;
case 'L':
- if(IsHideOper(user) != 0 != negate) matches++;
+ if((IsHideOper(user) != 0) != negate) matches++;
break;
case 'q':
- if(IsCommonChansOnly(user) != 0 != negate) matches++;
+ if((IsCommonChansOnly(user) != 0) != negate) matches++;
break;
}
}
NickChange(user, argv[1], 1);
} else {
struct server *serv;
- struct userNode *nuser;
char modes[MAXLEN];
/* new nick */
if (argc < 9)
unsplit_string(argv+6, argc-9, modes);
else
strcpy(modes, "+");
- nuser = AddUser(serv, argv[1], argv[4], argv[5], modes, argv[argc-2], argv[argc-1], atoi(argv[3]), argv[argc-3]);
+ AddUser(serv, argv[1], argv[4], argv[5], modes, argv[argc-2], argv[argc-1], atoi(argv[3]), argv[argc-3]);
}
return 1;
}
static CMD_FUNC(cmd_topic)
{
struct chanNode *cn;
- time_t chan_ts, topic_ts;
+ time_t topic_ts;
struct userNode *user;
if (argc < 3)
if (argc == 5) { /* Asuka / Topic Bursting IRCu's */
user = GetUserH(origin);
- chan_ts = atoi(argv[2]);
topic_ts = atoi(argv[3]);
} else if (argc >= 6) { /* Nefarious 0.5.0 */
user = GetUserH(strtok(argv[2], "!"));
- chan_ts = atoi(argv[3]);
topic_ts = atoi(argv[4]);
} else { /* Regular IRCu (No Topic Bursting)*/
user = GetUserH(origin);
- chan_ts = cn->timestamp;
topic_ts = now;
}
{
struct privmsg_desc pd;
struct server *srv;
- int nuser = 0;
if (argc != 3)
return 0;
pd.user = GetUserH(origin);
- if(!pd.user)
- nuser = 1;
if (!pd.user || (IsGagged(pd.user) && !IsOper(pd.user))) {
}
else {
cInfo = get_chanInfo(channel->name);
cData = channel->channel_info;
- if (!cInfo || !channel->channel_info) {
+ if (!cInfo || !cData) {
ss_reply("SSMSG_NOT_REGISTERED", channel->name);
return 0;
}
cInfo = get_chanInfo(channel->name);
cData = channel->channel_info;
- if (!cInfo || !channel->channel_info) {
+ if (!cInfo || !cData) {
ss_reply("SSMSG_NOT_REGISTERED", channel->name);
return 0;
}