summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-10 15:57:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-10 15:57:47 +0000
commit839f5721f5f4c317deebc5d207bcba5f90037e42 (patch)
treef0cfe116dce6374cfa16a42e51272f3a7d8d8ece
parent37f22f28a36270e8268652858ab6df1b4e0b0f7b (diff)
Fix ripemd160 warnings
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9446 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_ripemd160.cpp16
1 files changed, 9 insertions, 7 deletions
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)
+