Commit 312c10f5 authored by Kenton Varda's avatar Kenton Varda

Merge branch 'master' of github.com:kentonv/capnproto

parents 474ed8a1 f889d758
...@@ -56,10 +56,11 @@ public: ...@@ -56,10 +56,11 @@ public:
int urlSize = fastRand(100); int urlSize = fastRand(100);
static const char URL_PREFIX[] = "http://example.com/"; 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); strcpy(url.begin(), URL_PREFIX);
char* pos = url.begin() + strlen(URL_PREFIX); char* pos = url.begin() + urlPrefixLength;
for (int j = 0; j < urlSize; j++) { for (int j = 0; j < urlSize; j++) {
*pos++ = 'a' + fastRand(26); *pos++ = 'a' + fastRand(26);
} }
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include <stdexcept> #include <stdexcept>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <string>
#include <vector>
namespace capnp { namespace capnp {
namespace benchmark { namespace benchmark {
......
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