Commit f889d758 authored by Kenton Varda's avatar Kenton Varda

Merge pull request #48 from dwrensha/null-terminator

remove superfluous null terminator
parents 2ca06513 0fc7a601
......@@ -56,10 +56,11 @@ public:
int urlSize = fastRand(100);
static const char URL_PREFIX[] = "http://example.com/";
auto url = result.initUrl(urlSize + sizeof(URL_PREFIX));
size_t urlPrefixLength = strlen(URL_PREFIX);
auto url = result.initUrl(urlSize + urlPrefixLength);
strcpy(url.begin(), URL_PREFIX);
char* pos = url.begin() + strlen(URL_PREFIX);
char* pos = url.begin() + urlPrefixLength;
for (int j = 0; j < urlSize; j++) {
*pos++ = 'a' + fastRand(26);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment