From 43a376fd68197db472472db78afd7bb5545fde38 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 17 Mar 2008 17:28:54 +0000 Subject: [PATCH] Fix the warnings that are worth fixing, ignore the rest of gcc's nannying git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9117 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/inspircd.h | 2 +- src/modules.cpp | 2 +- src/modules/m_spanningtree/hmac.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/inspircd.h b/include/inspircd.h index 48718a668..84995710d 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -267,7 +267,7 @@ class CoreExport InspIRCd : public classbase private: /** Holds the current UID. Used to generate the next one. */ - char current_uid[UUID_LENGTH]; + char current_uid[UUID_LENGTH + 1]; /** Set up the signal handlers */ diff --git a/src/modules.cpp b/src/modules.cpp index 8fd1e84de..8a769ceb1 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -251,7 +251,7 @@ bool ModuleManager::SetPriority(Module* mod, Implementation i, PriorityState s, * on which they want, and we make sure our module is *at least* before or after * the first or last of this subset, depending again on the type of priority. */ - size_t swap_pos; + size_t swap_pos = 0; size_t source = 0; bool swap = true; bool found = false; diff --git a/src/modules/m_spanningtree/hmac.cpp b/src/modules/m_spanningtree/hmac.cpp index e01760dac..4ad6658b8 100644 --- a/src/modules/m_spanningtree/hmac.cpp +++ b/src/modules/m_spanningtree/hmac.cpp @@ -108,7 +108,8 @@ std::string TreeSocket::RandString(unsigned int ilength) if (f >= 0) { #ifndef WINDOWS - read(f, randombuf, ilength); + if (read(f, randombuf, ilength) < 1) + Instance->Logs->Log("m_spanningtree", DEFAULT, "There are crack smoking monkeys in your kernel (in other words, nonblocking /dev/urandom blocked.)"); close(f); #endif } -- 2.39.5