armink / struct2json

A fast convert library between the JSON and C structure. Implement structure serialization and deserialization for C. | C 结构体与 JSON 快速互转库,快速实现 C 结构体的序列化及反序列化
MIT License
680 stars 293 forks source link

关于编译器warring #9

Open ShareCat opened 4 years ago

ShareCat commented 4 years ago

这个写法编译器会提示warring: if (!(copy = (char*)cJSON_malloc(len))) return 0;

建议写成: copy = (char*)cJSON_malloc(len); if (!copy) return0;

armink commented 4 years ago

欢迎提交 pr