diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-24 18:08:05 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-24 18:08:05 +0000 |
commit | 68f8ee29fccb9d0fb7f440e14bcdd73a203f413d (patch) | |
tree | 5cd6db5577d1110ea472a370e22803e6a29f8a1b /src | |
parent | 28f7218e537cf3996d2cff81994aa00548ffee7c (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/users.cpp | 7 |
1 files 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) */ |