From aade4ed5a0e5e1c3d751baeff61c2ac5819b6446 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 23 Jan 2015 13:09:21 -0800 Subject: [PATCH] Remove uses of sprintf --- src/core/surface/completion_queue.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index e1cc114cda6..2bf31c50a8f 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -396,12 +396,13 @@ void grpc_event_finish(grpc_event *base) { void grpc_cq_dump_pending_ops(grpc_completion_queue *cc) { #ifndef NDEBUG - char tmp[256]; + char tmp[GRPC_COMPLETION_DO_NOT_USE * (1 + GPR_LTOA_MIN_BUFSIZE)]; char *p = tmp; int i; for (i = 0; i < GRPC_COMPLETION_DO_NOT_USE; i++) { - p += sprintf(p, " %d", (int)cc->pending_op_count[i]); + *p++ = ' '; + p += gpr_ltoa(cc->pending_op_count[i], p); } gpr_log(GPR_INFO, "pending ops:%s", tmp);