From 4798f98adad084cf9e207cc7b32d7e4370e9cc90 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 11 Feb 2008 10:26:18 +0000 Subject: Last of the -Wshadow fixes. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8894 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/hmac.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/modules/m_spanningtree/hmac.cpp') diff --git a/src/modules/m_spanningtree/hmac.cpp b/src/modules/m_spanningtree/hmac.cpp index 4b99a3eb7..6632ea907 100644 --- a/src/modules/m_spanningtree/hmac.cpp +++ b/src/modules/m_spanningtree/hmac.cpp @@ -95,30 +95,30 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string return password; } -std::string TreeSocket::RandString(unsigned int length) +std::string TreeSocket::RandString(unsigned int ilength) { - char* randombuf = new char[length+1]; + char* randombuf = new char[ilength+1]; std::string out; #ifdef WINDOWS - int fd = -1; + int f = -1; #else - int fd = open("/dev/urandom", O_RDONLY, 0); + int f = open("/dev/urandom", O_RDONLY, 0); #endif - if (fd >= 0) + if (f >= 0) { #ifndef WINDOWS - read(fd, randombuf, length); - close(fd); + read(f, randombuf, ilength); + close(f); #endif } else { - for (unsigned int i = 0; i < length; i++) + for (unsigned int i = 0; i < ilength; i++) randombuf[i] = rand(); } - for (unsigned int i = 0; i < length; i++) + for (unsigned int i = 0; i < ilength; i++) { char randchar = static_cast((randombuf[i] & 0x7F) | 0x21); out += (randchar == '=' ? '_' : randchar); -- cgit v1.3.1-10-gc9f91