From 839f5721f5f4c317deebc5d207bcba5f90037e42 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 10 Apr 2008 15:57:47 +0000 Subject: Fix ripemd160 warnings git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9446 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_ripemd160.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_ripemd160.cpp b/src/modules/m_ripemd160.cpp index 0768f523c..78b164315 100644 --- a/src/modules/m_ripemd160.cpp +++ b/src/modules/m_ripemd160.cpp @@ -434,12 +434,12 @@ class ModuleRIPEMD160 : public Module return (byte *)hashcode; } - unsigned int* key; + unsigned int* currkey; char* chars; public: - ModuleRIPEMD160(InspIRCd* Me) : Module(Me), key(NULL), chars("0123456789abcdef") + ModuleRIPEMD160(InspIRCd* Me) : Module(Me), currkey(NULL), chars("0123456789abcdef") { ServerInstance->Modules->PublishInterface("HashRequest", this); Implementation eventlist[] = { I_OnRequest }; @@ -457,7 +457,7 @@ class ModuleRIPEMD160 : public Module HashRequest* SHA = (HashRequest*)request; if (strcmp("KEY", request->GetId()) == 0) { - this->key = (unsigned int*)SHA->GetKeyData(); + this->currkey = (unsigned int*)SHA->GetKeyData(); } else if (strcmp("HEX", request->GetId()) == 0) { @@ -465,9 +465,8 @@ class ModuleRIPEMD160 : public Module } else if (strcmp("SUM", request->GetId()) == 0) { - int j = 0; static char* data; - data = (char*)RMD((byte *)SHA->GetHashData().data(),SHA->GetHashData().length(), key); + data = (char*)RMD((byte *)SHA->GetHashData().data(),SHA->GetHashData().length(), currkey); for (int i = 0, j = 0; i < RMDsize / 8; i++) { data[j++] = chars[data[i] / 16]; @@ -483,7 +482,7 @@ class ModuleRIPEMD160 : public Module else if (strcmp("RESET", request->GetId()) == 0) { this->chars = "0123456789abcdef"; - this->key = NULL; + this->currkey = NULL; } return NULL; } @@ -493,4 +492,7 @@ class ModuleRIPEMD160 : public Module return Version(1, 2, 0, 1, VF_VENDOR|VF_SERVICEPROVIDER, API_VERSION); } -}; \ No newline at end of file +}; + +MODULE_INIT(ModuleRIPEMD160) + -- cgit v1.2.3