do not zero allocated space, just append null character at the end of string

This commit is contained in:
Andrzej Rybczak
2009-03-27 14:47:18 +01:00
parent 2649c4a86b
commit 88c37b581d

View File

@@ -69,7 +69,6 @@ namespace
len = strlen(inbuf); len = strlen(inbuf);
size_t buflen = len*6+1; size_t buflen = len*6+1;
char *outbuf = new char[buflen]; char *outbuf = new char[buflen];
memset(outbuf, 0, sizeof(char)*buflen);
char *outstart = outbuf; char *outstart = outbuf;
char *instart = inbuf; char *instart = inbuf;
@@ -80,7 +79,7 @@ namespace
return; return;
} }
iconv_close(cd); iconv_close(cd);
*outbuf = 0;
str_pool_put(instart); str_pool_put(instart);
inbuf = str_pool_get(outstart); inbuf = str_pool_get(outstart);
delete [] outstart; delete [] outstart;