diff options
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp index 848f2a1eb..c6f5e498f 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1254,8 +1254,12 @@ const char* User::GetIPString() /* IP addresses starting with a : on irc are a Bad Thing (tm) */ if (*buf == ':') { - strlcpy(&temp[1], buf, sizeof(temp) - 1); - *temp = '0'; + if (!strncmp(buf, "::ffff:", 7) && isdigit(buf[7])) { + strlcpy(temp, buf+7, sizeof(temp) - 1); + } else { + strlcpy(&temp[1], buf, sizeof(temp) - 1); + *temp = '0'; + } this->cachedip = temp; return temp; } |