diff options
author | Sebastian Dröge <slomo@coaxion.net> | 2020-06-17 07:45:22 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@coaxion.net> | 2020-06-17 07:45:22 +0000 |
commit | ff7d5b36e7ee064864ebb414ded5bf59d681f42d (patch) | |
tree | 99a836b65722dba1897bc25f07b84971c9592ece /glib/gvariant.c | |
parent | bd7d7ccdf5d17af9c688deb9f3b7566d12b50063 (diff) | |
parent | 1519962792bc10c55993e5d0afe5103e1b56bf55 (diff) | |
download | glib-ff7d5b36e7ee064864ebb414ded5bf59d681f42d.tar.gz |
Merge branch 'variant-get-string-docs' into 'master'
gvariant: Fix documentation for g_variant_get_string() to match reality
See merge request GNOME/glib!1531
Diffstat (limited to 'glib/gvariant.c')
-rw-r--r-- | glib/gvariant.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/glib/gvariant.c b/glib/gvariant.c index 49fb60544..281fb34d6 100644 --- a/glib/gvariant.c +++ b/glib/gvariant.c @@ -1440,11 +1440,15 @@ g_variant_is_signature (const gchar *string) * type. This includes the types %G_VARIANT_TYPE_STRING, * %G_VARIANT_TYPE_OBJECT_PATH and %G_VARIANT_TYPE_SIGNATURE. * - * The string will always be UTF-8 encoded, and will never be %NULL. + * The string will always be UTF-8 encoded, will never be %NULL, and will never + * contain nul bytes. * * If @length is non-%NULL then the length of the string (in bytes) is * returned there. For trusted values, this information is already - * known. For untrusted values, a strlen() will be performed. + * known. Untrusted values will be validated and, if valid, a strlen() will be + * performed. If invalid, a default value will be returned — for + * %G_VARIANT_TYPE_OBJECT_PATH, this is `"/"`, and for other types it is the + * empty string. * * It is an error to call this function with a @value of any type * other than those three. |