diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-16 10:29:01 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-16 10:29:01 +0000 |
commit | fec45ead6390688476b9e2f03090777bbac4e07b (patch) | |
tree | 36e3e0ae6995b80e42e6017175cd91795ebb1392 /src | |
parent | 0060869dd57ca0239ef0d1b47c24e5f0ac98898f (diff) |
Remove second overridden (fully duplicated :/) copy of GetIPString which copies into a user specified buffer. It's not used anywhere, and is duplication ;(
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8218 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/users.cpp | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/src/users.cpp b/src/users.cpp index f487be6dc..2fb73c48b 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1139,6 +1139,10 @@ int User::GetProtocolFamily() return sin->sin_family; } +/* + * XXX the duplication here is horrid.. + * do we really need two methods doing essentially the same thing? + */ const char* User::GetIPString() { static char buf[1024]; @@ -1179,48 +1183,6 @@ const char* User::GetIPString() return ""; } -const char* User::GetIPString(char* buf) -{ - if (this->ip == NULL) - { - *buf = 0; - return buf; - } - - switch (this->GetProtocolFamily()) - { -#ifdef SUPPORT_IP6LINKS - case AF_INET6: - { - static char temp[1024]; - - sockaddr_in6* sin = (sockaddr_in6*)this->ip; - inet_ntop(sin->sin6_family, &sin->sin6_addr, buf, sizeof(buf)); - /* IP addresses starting with a : on irc are a Bad Thing (tm) */ - if (*buf == ':') - { - strlcpy(&temp[1], buf, sizeof(temp) - 1); - *temp = '0'; - strlcpy(buf, temp, sizeof(temp)); - } - return buf; - } - break; -#endif - case AF_INET: - { - sockaddr_in* sin = (sockaddr_in*)this->ip; - inet_ntop(sin->sin_family, &sin->sin_addr, buf, sizeof(buf)); - return buf; - } - break; - - default: - break; - } - return ""; -} - /** NOTE: We cannot pass a const reference to this method. * The string is changed by the workings of the method, * so that if we pass const ref, we end up copying it to |