From: Mina Naguib Date: Mon, 8 Feb 2016 01:55:25 +0000 (-0500) Subject: Clarify json_object_get_string documentation of NULL handling & returning X-Git-Tag: json-c-0.13-20171207~173^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F223%2Fhead;p=thirdparty%2Fjson-c.git Clarify json_object_get_string documentation of NULL handling & returning --- diff --git a/json_object.h b/json_object.h index 99b8edfe..69762505 100644 --- a/json_object.h +++ b/json_object.h @@ -670,14 +670,19 @@ extern struct json_object* json_object_new_string_len(const char *s, int len); /** Get the string value of a json_object * - * If the passed object is not of type json_type_string then the JSON - * representation of the object is returned. + * If the passed object is of type json_type_null (i.e. obj == NULL), + * NULL is returned. + * + * If the passed object of type json_type_string, the string contents + * are returned. + * + * Otherwise the JSON representation of the object is returned. * * The returned string memory is managed by the json_object and will * be freed when the reference count of the json_object drops to zero. * * @param obj the json_object instance - * @returns a string + * @returns a string or NULL */ extern const char* json_object_get_string(struct json_object *obj);