diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-10 16:09:26 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-10 16:09:26 +0000 |
commit | c492f5a98732d9d856e0846ece467d964dab646a (patch) | |
tree | ce1f5c63db4ecdebda5ec775fa7bb1a783c85a93 /src/modules | |
parent | 839f5721f5f4c317deebc5d207bcba5f90037e42 (diff) |
Whoops, overwriting hash with the hex isnt a good idea
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9447 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_ripemd160.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/m_ripemd160.cpp b/src/modules/m_ripemd160.cpp index 78b164315..b6fd27344 100644 --- a/src/modules/m_ripemd160.cpp +++ b/src/modules/m_ripemd160.cpp @@ -64,8 +64,8 @@ typedef unsigned char byte; typedef unsigned int dword; #else -typedef uint8_t byte; -typedef uint32_t dword; +typedef uint8_t byte; +typedef uint32_t dword; #endif /* collect four bytes into one word: */ @@ -435,7 +435,7 @@ class ModuleRIPEMD160 : public Module } unsigned int* currkey; - char* chars; + const char* chars; public: @@ -461,19 +461,19 @@ class ModuleRIPEMD160 : public Module } else if (strcmp("HEX", request->GetId()) == 0) { - this->chars = (char*)SHA->GetOutputs(); + this->chars = SHA->GetOutputs(); } else if (strcmp("SUM", request->GetId()) == 0) { - static char* data; - data = (char*)RMD((byte *)SHA->GetHashData().data(),SHA->GetHashData().length(), currkey); + static char output[MAXBUF]; + char* 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]; - data[j++] = chars[data[i] % 16]; - data[j] = '\0'; + output[j++] = chars[data[i] / 16]; + output[j++] = chars[data[i] % 16]; + output[j] = '\0'; } - return data; + return output; } else if (strcmp("NAME", request->GetId()) == 0) { |