From 68f8ee29fccb9d0fb7f440e14bcdd73a203f413d Mon Sep 17 00:00:00 2001 From: special Date: Thu, 24 Aug 2006 18:08:05 +0000 Subject: Moved an ipv6-only variable in userrec::GetIPString into the SUPPORT_IP6LINKS define to get rid of a warning git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5012 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/users.cpp b/src/users.cpp index fa407e2c2..085440367 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1193,7 +1193,6 @@ int userrec::GetProtocolFamily() const char* userrec::GetIPString() { static char buf[1024]; - static char temp[1024]; if (this->ip == NULL) return ""; @@ -1203,6 +1202,8 @@ const char* userrec::GetIPString() #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) */ @@ -1232,8 +1233,6 @@ const char* userrec::GetIPString() const char* userrec::GetIPString(char* buf) { - static char temp[1024]; - if (this->ip == NULL) { *buf = 0; @@ -1245,6 +1244,8 @@ const char* userrec::GetIPString(char* buf) #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) */ -- cgit v1.2.3