diff options
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; } |