diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-04 11:31:29 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-04 11:31:29 +0000 |
commit | e53d30bc6d4c3b002f08569b68affa540104d5cf (patch) | |
tree | 5e7082d9dbfc1b5b0501baab797b212e7e46442a /src | |
parent | 3119f46c8ad6fa1f8cbbd6aa2fe619acdb5732b7 (diff) |
Merge peaveys patch, tracker #162
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5642 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/users.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp index 4437449e3..a79f0a61d 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -339,9 +339,9 @@ userrec::~userrec() } } -/* XXX - minor point, other *Host functions return a char *, this one creates it. Might be nice to be consistant? */ -void userrec::MakeHost(char* nhost) +char* userrec::MakeHost() { + static char nhost[MAXBUF]; /* This is much faster than snprintf */ char* t = nhost; for(char* n = ident; *n; n++) @@ -350,6 +350,21 @@ void userrec::MakeHost(char* nhost) for(char* n = host; *n; n++) *t++ = *n; *t = 0; + return nhost; +} + +char* userrec::MakeHostIP() +{ + static char ihost[MAXBUF]; + /* This is much faster than snprintf */ + char* t = ihost; + for(char* n = ident; *n; n++) + *t++ = *n; + *t++ = '@'; + for(const char* n = this->GetIPString(); *n; n++) + *t++ = *n; + *t = 0; + return ihost; } void userrec::CloseSocket() |