aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/channel
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-01-27 11:39:14 -0800
committerGravatar Yang Gao <yangg@google.com>2015-01-27 11:39:14 -0800
commit3ed874c861765726b0a86ff610988f56e00db4a2 (patch)
tree59cd01424e74d37bdcc89d6c2a9bd3341aa3de81 /test/core/channel
parentd785904d0a0bcd1b8c2a7dee7681131e8f9d3417 (diff)
parent9a9f4051203b4e8f38107d08c39b8a586e6a8dc9 (diff)
sync up with master
Diffstat (limited to 'test/core/channel')
-rw-r--r--test/core/channel/metadata_buffer_test.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/core/channel/metadata_buffer_test.c b/test/core/channel/metadata_buffer_test.c
index 50fbcaea69..9d7e1591f8 100644
--- a/test/core/channel/metadata_buffer_test.c
+++ b/test/core/channel/metadata_buffer_test.c
@@ -32,6 +32,7 @@
*/
#include "src/core/channel/metadata_buffer.h"
+#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "test/core/util/test_config.h"
@@ -42,12 +43,12 @@
/* construct a buffer with some prefix followed by an integer converted to
a string */
static gpr_slice construct_buffer(size_t prefix_length, size_t index) {
- gpr_slice buffer = gpr_slice_malloc(prefix_length + 32);
+ gpr_slice buffer = gpr_slice_malloc(prefix_length + GPR_LTOA_MIN_BUFSIZE);
memset(GPR_SLICE_START_PTR(buffer), 'a', prefix_length);
GPR_SLICE_SET_LENGTH(
- buffer, prefix_length +
- sprintf((char *)GPR_SLICE_START_PTR(buffer) + prefix_length,
- "%d", (int)index));
+ buffer,
+ prefix_length +
+ gpr_ltoa(index, (char *)GPR_SLICE_START_PTR(buffer) + prefix_length));
return buffer;
}