diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-10 16:21:50 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-10 16:21:50 +0000 |
commit | ba62e7be6266989c1c3af7853e70e20230ebd571 (patch) | |
tree | 29e34577c0a5ff913ccb2d30d71f05176844f83f | |
parent | 193ab9605b0213cb65349fae487391978d3ccd6b (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/trunk@2547 5417fbe8-f217-4b02-8779-1006273d7864
-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 38fc51923..77b2726be 100644 --- a/src/core/bs_kick.c +++ b/src/core/bs_kick.c @@ -47,6 +47,7 @@ class CommandBSKick : public Command if (option == "BADWORDS") { if (value == "ON") { if (ttb) { + errno = 0; ci->ttb[TTB_BADWORDS] = strtol(ttb, NULL, 10); /* Only error if errno returns ERANGE or EINVAL or we are less then 0 - TSL */ @@ -77,6 +78,7 @@ class CommandBSKick : public Command } else if (option == "BOLDS") { if (value == "ON") { if (ttb) { + errno = 0; ci->ttb[TTB_BOLDS] = strtol(ttb, NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_BOLDS] < 0) { @@ -105,6 +107,7 @@ class CommandBSKick : public Command char *percent = strtok(NULL, " "); if (ttb) { + errno = 0; ci->ttb[TTB_CAPS] = strtol(ttb, NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_CAPS] < 0) { @@ -147,6 +150,7 @@ class CommandBSKick : public Command } else if (option == "COLORS") { if (value == "ON") { if (ttb) { + errno = 0; ci->ttb[TTB_COLORS] = strtol(ttb, NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_COLORS] < 0) { @@ -175,6 +179,7 @@ class CommandBSKick : public Command char *secs = strtok(NULL, " "); if (ttb) { + errno = 0; ci->ttb[TTB_FLOOD] = strtol(ttb, NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_FLOOD] < 0) { @@ -219,6 +224,7 @@ class CommandBSKick : public Command char *times = strtok(NULL, " "); if (ttb) { + errno = 0; ci->ttb[TTB_REPEAT] = strtol(ttb, NULL, 10); if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_REPEAT] < 0) { @@ -253,6 +259,7 @@ class CommandBSKick : public Command } else if (option == "REVERSES") { if (value == "ON") { if (ttb) { + errno = 0; ci->ttb[TTB_REVERSES] = strtol(ttb, NULL, 10); if (errno == ERANGE || errno == EINVAL @@ -279,6 +286,7 @@ class CommandBSKick : public Command } else if (option == "UNDERLINES") { if (value == "ON") { if (ttb) { + errno = 0; ci->ttb[TTB_UNDERLINES] = strtol(ttb, NULL, 10); if (errno == ERANGE || errno == EINVAL |