From 303c3fcf1cc64795d6a81d00d3d5aeaa32d1644d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 24 Aug 2020 15:18:10 +0100 Subject: Document json_from_string() nullability The function can return NULL even without setting an error, so we need to add a `nullable` annotation. While at it, document the handling of empty strings more explicitly. Fixes: #46 --- json-glib/json-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'json-glib/json-utils.c') diff --git a/json-glib/json-utils.c b/json-glib/json-utils.c index 2ba3690..5fc8496 100644 --- a/json-glib/json-utils.c +++ b/json-glib/json-utils.c @@ -37,12 +37,12 @@ * @error: return location for a #GError * * Parses the string in @str and returns a #JsonNode representing - * the JSON tree. + * the JSON tree. If @str is empty, this function will return %NULL. * * In case of parsing error, this function returns %NULL and sets * @error appropriately. * - * Returns: (transfer full): a #JsonNode, or %NULL + * Returns: (transfer full) (nullable): a #JsonNode, or %NULL * * Since: 1.2 */ -- cgit v1.2.1