diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 13:36:11 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 13:36:11 +0000 |
commit | aee072aed76b352a46ab5c2bb26b2c03b89e7281 (patch) | |
tree | 083dba55337b5edc640a9e42a3f7efb79e53bbe9 | |
parent | c125dd1decee96ddbde3cfd5dc72fe2206c87376 (diff) |
Fixed sigabrt
NOTE to w00t: When a user gets allocated a uid that is duplicate, the constructor throws. This was happening because i didnt pay attention to what i wrote and it always added uid "" :P
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7881 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/users.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/users.cpp b/src/users.cpp index 72cf2103d..573d1b14d 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -345,14 +345,17 @@ userrec::userrec(InspIRCd* Instance, const std::string &uid) : ServerInstance(In memset(snomasks,0,sizeof(snomasks)); /* Invalidate cache */ operquit = cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL; + if (!uid.empty()) + strlcpy(uuid, Instance->GetUID().c_str(), UUID_LENGTH); + else strlcpy(uuid, uid.c_str(), UUID_LENGTH); user_hash::iterator finduuid = Instance->uuidlist->find(uuid); if (finduuid != Instance->uuidlist->end()) (*Instance->uuidlist)[uuid] = this; else - throw CoreException("Duplicate UUID "+uid+" in userrec constructor"); + throw CoreException("Duplicate UUID "+std::string(uuid)+" in userrec constructor"); } void userrec::RemoveCloneCounts() |