Remove use of sprintf

pull/188/head
Craig Tiller 10 years ago
parent d862369d63
commit 37d4eb56f0
  1. 7
      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"
@ -45,9 +46,9 @@ static gpr_slice construct_buffer(size_t prefix_length, size_t index) {
gpr_slice buffer = gpr_slice_malloc(prefix_length + 32);
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;
}

Loading…
Cancel
Save