From 27b2f3e93971a9847614d35ec149a51b9a69ee3c Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Sat, 21 Jan 2017 14:23:57 +1100 Subject: [PATCH] Change ignore_type() arguments to (const char *, size_t) This just changes the arguments to match the strncmp() calls in the function. --- include/ignore.h | 2 +- source/ignore.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/ignore.h b/include/ignore.h index 678de7e..26e10b0 100644 --- a/include/ignore.h +++ b/include/ignore.h @@ -57,7 +57,7 @@ int check_ignore (char *, char *, char *, long, char *); void ignore (char *, char *, char *, char *); void tignore (char *, char *, char *, char *); void ignore_nickname (char *, long, int); -long ignore_type (char *, int); +long ignore_type(const char *, size_t); int check_is_ignored(char *); char *get_ignores_by_pattern (char *patterns, int covered); int get_type_by_desc (char *type, int *do_mask, int *dont_mask); diff --git a/source/ignore.c b/source/ignore.c index 0c96ea3..ac0f2c8 100644 --- a/source/ignore.c +++ b/source/ignore.c @@ -571,11 +571,13 @@ static void ignore_list(char *nick) bitchsay("There are no nicknames or channels being ignored"); } -long ignore_type (char *type, int len) +long ignore_type(const char *type, size_t len) { -long ret = -1; + long ret = -1; + if (!type || !*type) return -1; + if (!strncmp(type, "ALL", len)) ret = IGNORE_ALL; else if (!strncmp(type, "MSGS", len))