You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/09/19 18:20:04 UTC

git commit: TS-2945 Use strtol()

Repository: trafficserver
Updated Branches:
  refs/heads/master 5e2ccfd3d -> 996237393


TS-2945 Use strtol()


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/99623739
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/99623739
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/99623739

Branch: refs/heads/master
Commit: 996237393058430ec16fca8472a1f8c7ba7702f5
Parents: 5e2ccfd
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Sep 19 10:09:50 2014 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Sep 19 10:09:54 2014 -0600

----------------------------------------------------------------------
 plugins/experimental/balancer/balancer.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/99623739/plugins/experimental/balancer/balancer.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/balancer/balancer.cc b/plugins/experimental/balancer/balancer.cc
index f3226ca..71b06b8 100644
--- a/plugins/experimental/balancer/balancer.cc
+++ b/plugins/experimental/balancer/balancer.cc
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <getopt.h>
 #include <string.h>
+#include <stdlib.h>
 #include <iterator>
 
 // Using ink_inet API is cheating, but I was too lazy to write new IPv6 address parsing routines ;)
@@ -72,7 +73,7 @@ MakeBalancerTarget(const char * strval)
     if (colon) {
       size_t len = std::distance(strval, colon);
 
-      target.port = atoi(colon + 1);
+      target.port = strtol(colon + 1, NULL, 10);
       target.name = std::string(strval, len);
     } else {
       target.port = 0;