X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/8c7baf9e90af4216ce1bc87a8b3515e5a6cfd940..4bad641268aaf62bea32a69e6d99edbe38aa242a:/helpmod2/hcommands.c diff --git a/helpmod2/hcommands.c b/helpmod2/hcommands.c index c16a0d23..56b2574b 100644 --- a/helpmod2/hcommands.c +++ b/helpmod2/hcommands.c @@ -1038,7 +1038,7 @@ void helpmod_cmd_term (huser *sender, channel* returntype, char* ostr, int argc, } if (strregexp(htrm->description->content, pattern) || strregexp(htrm->name->content, pattern)) { - sprintf(buffer+strlen(buffer) /* :) */, "%s(%d) ", htrm->name->content, strlen(htrm->description->content)); + sprintf(buffer+strlen(buffer) /* :) */, "%s(%u) ", htrm->name->content, (unsigned int)strlen(htrm->description->content)); count++; } } @@ -2657,9 +2657,9 @@ static void helpmod_cmd_checkchannel(huser *sender, channel* returntype, char* o if (IsAccount(nck)) authed_count++; - if (IsOper(nck) && strlen(nck->nick) > 1) + if (IsOper(nck) && strlen(nck->nick) > 1 && (IsSecret(chan) || IsPrivate(chan) || IsKey(chan) || IsInviteOnly(chan))) { - helpmod_reply(sender, returntype, "Cannot check channel: Permission denied. Channel %s has an oper on it", argv[0]); + helpmod_reply(sender, returntype, "Cannot check channel: Permission denied. Channel %s has an oper on it and one or more of +i/+k/+p/+s", argv[0]); return; } } @@ -3774,7 +3774,7 @@ void helpmod_command(huser *sender, channel* returntype, char *args) { int argc = 0, useless_var; char args_copy[512]; - char *parsed_args[H_CMD_MAX_ARGS + 3], *ptr = args_copy; + char *parsed_args[H_CMD_MAX_ARGS + 4], *ptr = args_copy; /* only accept commands from valid sources */ if (huser_get_level(sender) > H_ADMIN) @@ -3791,9 +3791,11 @@ void helpmod_command(huser *sender, channel* returntype, char *args) if (*args == '-' || *args == '?') args++; - strcpy(args_copy, args); + strncpy(args_copy, args, (sizeof(args_copy) - 1)); + args_copy[sizeof(args_copy) - 1] = '\0'; + /* FIX stringituki */ - while (argc < 10) + while (argc < (H_CMD_MAX_ARGS + 4)) { while (isspace(*ptr) && *ptr) ptr++;