From 2daf18131cc7b8f9f495a706d72fd02afc7ff513 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 5 Jan 2016 19:06:05 -0600 Subject: [PATCH] chmode: sscanf(3) returns the number of items matched, so might as well use it --- src/chmode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chmode.c b/src/chmode.c index d4d19619f..4cf3cb5c6 100644 --- a/src/chmode.c +++ b/src/chmode.c @@ -1163,7 +1163,8 @@ chm_throttle(struct Client *source_p, struct Channel *chptr, if((dir == MODE_ADD) && parc > *parn) { - sscanf(parv[(*parn)], "%d:%d", &joins, ×lice); + if (sscanf(parv[(*parn)], "%d:%d", &joins, ×lice) < 2) + return; if(joins <= 0 || timeslice <= 0) return;