mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
handle null pointers: cJSON_Minify
This commit is contained in:
parent
39745c9c75
commit
24ea388dcf
6
cJSON.c
6
cJSON.c
@ -2390,6 +2390,12 @@ fail:
|
|||||||
CJSON_PUBLIC(void) cJSON_Minify(char *json)
|
CJSON_PUBLIC(void) cJSON_Minify(char *json)
|
||||||
{
|
{
|
||||||
unsigned char *into = (unsigned char*)json;
|
unsigned char *into = (unsigned char*)json;
|
||||||
|
|
||||||
|
if (json == NULL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while (*json)
|
while (*json)
|
||||||
{
|
{
|
||||||
if (*json == ' ')
|
if (*json == ' ')
|
||||||
|
Loading…
Reference in New Issue
Block a user