cpp: Fix max TCP port number

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920671 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TSocket.cpp b/lib/cpp/src/transport/TSocket.cpp
index f99a6ff..55e8dc3 100644
--- a/lib/cpp/src/transport/TSocket.cpp
+++ b/lib/cpp/src/transport/TSocket.cpp
@@ -230,7 +230,7 @@
   }
 
   // Validate port number
-  if (port_ < 0 || port_ > 65536) {
+  if (port_ < 0 || port_ > 0xFFFF) {
     throw TTransportException(TTransportException::NOT_OPEN, "Specified port is invalid");
   }
 
@@ -238,7 +238,7 @@
   res = NULL;
   res0 = NULL;
   int error;
-  char port[sizeof("65536")];
+  char port[sizeof("65535")];
   std::memset(&hints, 0, sizeof(hints));
   hints.ai_family = PF_UNSPEC;
   hints.ai_socktype = SOCK_STREAM;