diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-02 22:45:48 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-02 22:45:48 +0000 |
commit | 0b304e377df9e12fa00618da1b8e03b4eb377240 (patch) | |
tree | c46e9110fa9e35c9b6eb39a89b700344523a6e92 /src | |
parent | b9b7a3a2cf4ccca33fe062bd3c626ee9c737d1e7 (diff) |
std::string does not need a null terminator..
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7419 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/hashcomp.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 55bad8bf7..4f59f7a5b 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -292,7 +292,7 @@ std::string irc::hex(const unsigned char *raw, size_t rawsz) const char *hex = "0123456789abcdef"; std::string buf; - buf.reserve(rawsz * 2 + 1); + buf.reserve(rawsz * 2); size_t i, j; for (i = 0, j = 0; j < rawsz; ++j) @@ -300,7 +300,6 @@ std::string irc::hex(const unsigned char *raw, size_t rawsz) buf[i++] = hex[raw[j] / 16]; buf[i++] = hex[raw[j] % 16]; } - buf[i] = '\0'; return buf; } |