diff options
author | Adam <Adam@Anope.org> | 2010-05-24 23:36:40 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-18 21:04:05 -0400 |
commit | 2fba686904e6f78ebab35df171c5757afeebf05d (patch) | |
tree | 523782bccc479606206f271cd6708b2f70fe8278 /src/misc.c | |
parent | 3a2c2a916a26f4fa1844e71a9f1c2fc25337fd2b (diff) |
Burned slist, rewrote operservs XLine code
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/misc.c b/src/misc.c index d7060660e..22ea81432 100644 --- a/src/misc.c +++ b/src/misc.c @@ -226,6 +226,7 @@ const char *merge_args(int argc, char **argv) NumberList::NumberList(const std::string &list) { + char *error; commasepstream sep(list); std::string token; @@ -238,9 +239,8 @@ NumberList::NumberList(const std::string &list) if (!h) { - errno = 0; - unsigned num = strtol(token.c_str(), NULL, 10); - if (!errno) + unsigned num = strtol(token.c_str(), &error, 10); + if (*error == '\0') { numbers.insert(num); } @@ -255,11 +255,11 @@ NumberList::NumberList(const std::string &list) } else { + char *error2; *h++ = '\0'; - errno = 0; - unsigned num1 = strtol(token.c_str(), NULL, 10); - unsigned num2 = strtol(h, NULL, 10); - if (!errno) + unsigned num1 = strtol(token.c_str(), &error, 10); + unsigned num2 = strtol(h, &error2, 10); + if (*error == '\0' && *error2 == '\0') { for (unsigned i = num1; i <= num2; ++i) { |