修复 bool类型解析错误

This commit is contained in:
Letter 2021-10-17 13:12:00 +08:00
parent d043ea1d29
commit 56b488a776
1 changed files with 1 additions and 1 deletions

View File

@ -295,7 +295,7 @@ void *csonDecodeObject(cJSON *json, CsonModel *model, int modelSize)
*(double *)((int)obj + model[i].offset) = csonDecodeDouble(json, model[i].key);
break;
case CSON_TYPE_BOOL:
*(char *)((int)obj + model[i].offset) = (char)csonDecodeNumber(json, model[i].key);
*(char *)((int)obj + model[i].offset) = (char)csonDecodeBool(json, model[i].key);
break;
case CSON_TYPE_STRING:
*(int *)((int)obj + model[i].offset) = (int)csonDecodeString(json, model[i].key);