From: special Date: Mon, 2 Jul 2007 22:45:48 +0000 (+0000) Subject: std::string does not need a null terminator.. X-Git-Tag: v2.0.23~5006 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=0b304e377df9e12fa00618da1b8e03b4eb377240;p=user%2Fhenk%2Fcode%2Finspircd.git std::string does not need a null terminator.. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7419 e03df62e-2008-0410-955e-edbf42e46eb7 --- 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; }