chmode: sscanf(3) returns the number of items matched, so might as well use it

This commit is contained in:
William Pitcock 2016-01-05 19:06:05 -06:00
parent 90552e214c
commit 2daf18131c

View file

@ -1163,7 +1163,8 @@ chm_throttle(struct Client *source_p, struct Channel *chptr,
if((dir == MODE_ADD) && parc > *parn) if((dir == MODE_ADD) && parc > *parn)
{ {
sscanf(parv[(*parn)], "%d:%d", &joins, &timeslice); if (sscanf(parv[(*parn)], "%d:%d", &joins, &timeslice) < 2)
return;
if(joins <= 0 || timeslice <= 0) if(joins <= 0 || timeslice <= 0)
return; return;