From aee072aed76b352a46ab5c2bb26b2c03b89e7281 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 27 Aug 2007 13:36:11 +0000 Subject: 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 --- src/users.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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() -- cgit v1.2.3