diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-08-24 15:18:10 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-08-24 17:44:07 +0100 |
commit | 303c3fcf1cc64795d6a81d00d3d5aeaa32d1644d (patch) | |
tree | 2bcbf1398df06a25ca500c994b000807ed6b51c6 /json-glib/json-utils.c | |
parent | 3978fc21c75f527f1220c15c9e2427c6a0b7a08d (diff) | |
download | json-glib-303c3fcf1cc64795d6a81d00d3d5aeaa32d1644d.tar.gz |
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
Diffstat (limited to 'json-glib/json-utils.c')
-rw-r--r-- | json-glib/json-utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 */ |