提交 37963a72 编写于 作者: D Dave Gamble

Don't crash if someone calls cJSON_Print(0);



git-svn-id: http://svn.code.sf.net/p/cjson/code@24 e3330c51-1366-4df0-8b21-3ccf24e3d50e
上级 091c0676
...@@ -256,6 +256,7 @@ static const char *parse_value(cJSON *item,const char *value) ...@@ -256,6 +256,7 @@ static const char *parse_value(cJSON *item,const char *value)
// Render a value to text. // Render a value to text.
static char *print_value(cJSON *item,int depth,int fmt) static char *print_value(cJSON *item,int depth,int fmt)
{ {
if (!item) return 0;
char *out=0; char *out=0;
switch ((item->type)&255) switch ((item->type)&255)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册