aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/json/json_string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/json/json_string.c b/src/core/json/json_string.c
index 785ec50411..03c1099167 100644
--- a/src/core/json/json_string.c
+++ b/src/core/json/json_string.c
@@ -83,7 +83,7 @@ static void json_writer_output_check(void* userdata, size_t needed) {
if (state->free_space >= needed) return;
needed -= state->free_space;
/* Round up by 256 bytes. */
- needed = (needed + 0xff) % 0x100;
+ needed = (needed + 0xff) & ~0xffU;
state->output = gpr_realloc(state->output, state->allocated + needed);
state->free_space += needed;
state->allocated += needed;