#include <sys/types.h>
#include <dirent.h>
+#include "../lib/strlfunc.h"
+
#include "hcommands.h"
#include "hcommand.h"
}
else
{
- strcpy(hchan->welcome, ostr);
+ strlcpy(hchan->welcome, ostr, HCHANNEL_WELCOME_LEN);
helpmod_reply(sender, returntype, "Welcome message for channel %s (%s) is now: %s", hchan->real_channel->index->name->content, hchannel_get_state(hchan, H_WELCOME), hchan->welcome);
}
}
if (huser_get_level((*hchanuser)->husr) < H_TRIAL)
if (kickmode == HELPMOD_KICKMODE_ALL || (kickmode == HELPMOD_KICKMODE_UNAUTHED && !IsAccount((*hchanuser)->husr->real_user)))
{
- helpmod_kick(hchan, (*hchanuser)->husr, reason);
+ helpmod_kick(hchan, (*hchanuser)->husr, "%s", reason);
continue;
}
hchanuser = &(*hchanuser)->next;
}
for (i=0;i<ntargets;i++)
- helpmod_kick(hchan, targets[i], reason);
+ helpmod_kick(hchan, targets[i], "%s", reason);
}
static void helpmod_cmd_stats (huser *sender, channel* returntype, char* ostr, int argc, char *argv[])
switch (listtype)
{
case 0:
- for (i=0;i < arr.arrlen && arr.array[i].prime_time_spent > H_ACTIVE_LIMIT;i++)
- helpmod_reply(sender, returntype, "#%-2d %-20s %-20s %-20s", i+1,((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
+ for (i=0;i < arr.arrlen;i++)
+ if (arr.array[i].prime_time_spent > H_ACTIVE_LIMIT)
+ helpmod_reply(sender, returntype, "#%-2d %-20s %-20s %-20s", i+1,((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
break;
case 1:
- for (i=arr.arrlen-1;i >= 0 && arr.array[i].prime_time_spent < H_ACTIVE_LIMIT;i--)
- helpmod_reply(sender, returntype, "#%-2d %-20s %-20s %-20s", (arr.arrlen - i),((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
+ for (i=arr.arrlen-1;i >= 0;i--)
+ if (arr.array[i].prime_time_spent < H_ACTIVE_LIMIT)
+ helpmod_reply(sender, returntype, "#%-2d %-20s %-20s %-20s", (arr.arrlen - i),((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
break;
}
husr = huser_get(getnickbynick(argv[i]));
if (husr == NULL)
{
- helpmod_reply(sender, returntype, "Cannot change mode: User %s not found", argv[i], hchannel_get_name(hchan));
+ helpmod_reply(sender, returntype, "Cannot change mode: User %s not found", argv[i]);
continue;
}
huserchan = huser_on_channel(husr, hchan);
if (bufpos > (384 - (HED_FILENAME_LENGTH+1)))
{
- helpmod_reply(sender, returntype, buffer);
+ helpmod_reply(sender, returntype, "%s", buffer);
bufpos = 0;
}
}
if (bufpos)
- helpmod_reply(sender, returntype, buffer);
+ helpmod_reply(sender, returntype, "%s", buffer);
free(start);
free(lines);
helpmod_reply(sender, returntype, "Weekly statistics for %ss on channel %s", hlevel_name(lvl), hchannel_get_name(hchan));
- for (i=0;i < arr.arrlen && arr.array[i].time_spent > HDEF_m;i++)
+ for (i=0;i < arr.arrlen;i++)
+ if (arr.array[i].time_spent > HDEF_m)
helpmod_reply(sender, returntype, "%-20s %-20s %-20s",((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
free(arr.array);
helpmod_reply(sender, returntype, "Channels %d", hchannel_count());
helpmod_reply(sender, returntype, "Accounts %d", haccount_count(H_ANY));
helpmod_reply(sender, returntype, "Users %d", huser_count());
- helpmod_reply(sender, returntype, "Help entries %d", helpmod_entry_count(helpmod_base));
+ helpmod_reply(sender, returntype, "Help entries %ld", helpmod_entry_count(helpmod_base));
helpmod_reply(sender, returntype, "Bans %d", hban_count());
- helpmod_reply(sender, returntype, "Help provided %d", helpmod_usage);
+ helpmod_reply(sender, returntype, "Help provided %ld", helpmod_usage);
helpmod_reply(sender, returntype, "Tickets %d", hticket_count());
}