提交 4d84acf9 编写于 作者: M Max Bruckner

print_number: fix Off-By-One error

Thanks @liuyunbin for reporting this in #230
上级 28d4410f
...@@ -512,7 +512,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out ...@@ -512,7 +512,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out
} }
/* reserve appropriate space in the output */ /* reserve appropriate space in the output */
output_pointer = ensure(output_buffer, (size_t)length); output_pointer = ensure(output_buffer, (size_t)length + sizeof(""));
if (output_pointer == NULL) if (output_pointer == NULL)
{ {
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册