Hi, I dont know if is a part of the design that the path patch must begin with ' / ', because strrchr return NULL if not found ' / ', to avoid the segmentation fault I did the following, but I don't know if this is the best approach but it works.
In cJSON_Utils.c
Line 96:
parentptr=strdup(path); childptr=strrchr(parentptr,'/'); if (childptr) *childptr++=0; else childptr = parentptr;
Line173:
parentptr=strdup(path->valuestring); childptr=strrchr(parentptr,'/'); if (childptr) *childptr++=0; else childptr = parentptr;
Hi, I dont know if is a part of the design that the path patch must begin with ' / ', because strrchr return NULL if not found ' / ', to avoid the segmentation fault I did the following, but I don't know if this is the best approach but it works.
In cJSON_Utils.c Line 96:
Line173: