Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check for NULL in tokenize, fix slightly off parv checking in help an…

…d raw
  • Loading branch information...
commit a5e31c7a23a09cb30fc7ec4cfaddeb67c505a71e 1 parent b75a8f7
@alyx authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  modules/admin/raw.c
  2. +2 −2 modules/core/help.c
  3. +1 −1  src/tokenize.c
View
2  modules/admin/raw.c
@@ -25,7 +25,7 @@ static void cmd_raw(const irc_event_t *event, int parc, char **parv)
buffer = mowgli_alloc(BUFSIZE);
- for (i = 1; i <= parc; i++)
+ for (i = 1; i < parc; i++)
{
printf("Adding %s to buffer.\n", parv[i]);
/*snprintf(buffer, BUFSIZE, "%s %s", buffer, parv[i]);*/
View
4 modules/core/help.c
@@ -20,7 +20,7 @@ static void cmd_help(const irc_event_t *event, int parc, char **parv)
{
command_t *cmd;
- if (parc < 1)
+ if (parc < 2)
{
command_fail(CMD_NEEDSPARAM, event->origin, "help");
return;
@@ -29,7 +29,7 @@ static void cmd_help(const irc_event_t *event, int parc, char **parv)
cmd = command_find(parv[1]);
if (cmd == NULL)
{
- irc_notice(event->origin->nick, "Command %s does not exist.");
+ irc_notice(event->origin->nick, "Command %s does not exist.", parv[1]);
return;
}
View
2  src/tokenize.c
@@ -19,7 +19,7 @@ int tokenize(char *message, char **parv)
printf("%d\n", i);
parv[i] = token;
i++;
- if ((strlen(save)) < 1)
+ if (save == NULL || (strlen(save)) < 1)
break;
}
if ((i > MAXPARC) && (save != NULL))
Please sign in to comment.
Something went wrong with that request. Please try again.