From 3c8228df1534df1e048a030e584a9b261732fdc6 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 2 Apr 2016 13:31:04 +0200 Subject: [PATCH] Fixed: Empty const char* because std::string destructor called --HG-- branch : develop --- code/nel/src/net/inet_address.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/nel/src/net/inet_address.cpp b/code/nel/src/net/inet_address.cpp index e5b0280ab..f5d22ebe3 100644 --- a/code/nel/src/net/inet_address.cpp +++ b/code/nel/src/net/inet_address.cpp @@ -780,12 +780,12 @@ bool CInetAddress::is127001 () const bool CInetAddress::isLoopbackIPAddress () const { - const char *sIPAddress = ipAddress().c_str(); + std::string sIPAddress = ipAddress(); - return (strcmp(sIPAddress, "::") == 0) || - (strcmp(sIPAddress, "::1") == 0) || - (strcmp(sIPAddress, "127.0.0.1") == 0) || - (strcmp(sIPAddress, "0:0:0:0:0:0:0:1") == 0); + return (sIPAddress.compare("::") == 0) || + (sIPAddress.compare("::1") == 0) || + (sIPAddress.compare("127.0.0.1") == 0) || + (sIPAddress.compare("0:0:0:0:0:0:0:1") == 0); }