diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-10 16:21:29 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-10 16:21:29 +0000 |
commit | 6ad63349c1840705a883506e4dea19b986a62e8a (patch) | |
tree | c644e29205ccbd4722b25c2849423e8b41c2854b /src | |
parent | d0646a37dc15f97b6cebf0764263457faa944ea4 (diff) |
Reset errno before calling strtol in bs_kick, it would sometimes not allow valid kick settings to work
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2546 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/core/bs_kick.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c index 036364aa8..c6ec38106 100644 --- a/src/core/bs_kick.c +++ b/src/core/bs_kick.c @@ -117,6 +117,7 @@ int do_kickcmd(User * u) if (!stricmp(option, "BADWORDS")) { if (!stricmp(value, "ON")) { if (ttb) { + errno = 0; ci->ttb[TTB_BADWORDS] = strtol(ttb, (char **) NULL, 10); /* Only error if errno returns ERANGE or EINVAL or we are less then 0 - TSL */ @@ -147,6 +148,7 @@ int do_kickcmd(User * u) } else if (!stricmp(option, "BOLDS")) { if (!stricmp(value, "ON")) { if (ttb) { + errno = 0; ci->ttb[TTB_BOLDS] = strtol(ttb, (char **) NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_BOLDS] < 0) { @@ -175,6 +177,7 @@ int do_kickcmd(User * u) char *percent = strtok(NULL, " "); if (ttb) { + errno = 0; ci->ttb[TTB_CAPS] = strtol(ttb, (char **) NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_CAPS] < 0) { @@ -217,6 +220,7 @@ int do_kickcmd(User * u) } else if (!stricmp(option, "COLORS")) { if (!stricmp(value, "ON")) { if (ttb) { + errno = 0; ci->ttb[TTB_COLORS] = strtol(ttb, (char **) NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_COLORS] < 0) { @@ -245,6 +249,7 @@ int do_kickcmd(User * u) char *secs = strtok(NULL, " "); if (ttb) { + errno = 0; ci->ttb[TTB_FLOOD] = strtol(ttb, (char **) NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_FLOOD] < 0) { @@ -289,6 +294,7 @@ int do_kickcmd(User * u) char *times = strtok(NULL, " "); if (ttb) { + errno = 0; ci->ttb[TTB_REPEAT] = strtol(ttb, (char **) NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_REPEAT] < 0) { @@ -323,6 +329,7 @@ int do_kickcmd(User * u) } else if (!stricmp(option, "REVERSES")) { if (!stricmp(value, "ON")) { if (ttb) { + errno = 0; ci->ttb[TTB_REVERSES] = strtol(ttb, (char **) NULL, 10); if (errno == ERANGE || errno == EINVAL @@ -349,6 +356,7 @@ int do_kickcmd(User * u) } else if (!stricmp(option, "UNDERLINES")) { if (!stricmp(value, "ON")) { if (ttb) { + errno = 0; ci->ttb[TTB_UNDERLINES] = strtol(ttb, (char **) NULL, 10); if (errno == ERANGE || errno == EINVAL |