Explicitly add terminating null character.

pull/7415/head
Robbie Shade 9 years ago
parent 61aed92b82
commit c6f776752d
  1. 3
      test/core/end2end/tests/payload.c

@ -102,9 +102,10 @@ static gpr_slice generate_random_slice() {
size_t i;
static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
char output[1024 * 1024]; /* 1 MB */
for (i = 0; i < 1024 * 1024; ++i) {
for (i = 0; i < 1024 * 1024 - 1; ++i) {
output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
}
output[1024 * 1024 - 1] = '\0';
return gpr_slice_from_copied_string(output);
}

Loading…
Cancel
Save