summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-10 16:21:29 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-10 16:21:29 +0000
commit6ad63349c1840705a883506e4dea19b986a62e8a (patch)
treec644e29205ccbd4722b25c2849423e8b41c2854b
parentd0646a37dc15f97b6cebf0764263457faa944ea4 (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
-rw-r--r--src/core/bs_kick.c8
-rw-r--r--version.log3
2 files changed, 10 insertions, 1 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
diff --git a/version.log b/version.log
index 5626d8820..b232c9a99 100644
--- a/version.log
+++ b/version.log
@@ -9,9 +9,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="2"
VERSION_EXTRA="-svn"
-VERSION_BUILD="2545"
+VERSION_BUILD="2546"
# $Log$ # Changes since 1.8.2 Release
+#Revision 2546 - Reset errno before calling strtol in bs_kick, it would sometimes not allow valid kick settings to work
#Revision 2545 - Now send the QUIT command before changing bots internally for /botserv bot change, so InspIRCd 1.2 (and possibly others) can get the UID and other info from the bot
#Revision 2544 - Fixed the NICK command syntax on InspIRCd 1.2 to work when changing clients nicknames
#Revision 2543 - Fixed crash when juping servers on InspIRCd 1.2