]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
std::string does not need a null terminator..
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 2 Jul 2007 22:45:48 +0000 (22:45 +0000)
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 2 Jul 2007 22:45:48 +0000 (22:45 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7419 e03df62e-2008-0410-955e-edbf42e46eb7

src/hashcomp.cpp

index 55bad8bf7a59bbc59be889e2c2d6b446f4d3e316..4f59f7a5bda85a6e0d2d33111668709a836b3512 100644 (file)
@@ -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;
 }