glib: add parameter annotations for g_vasprintf and callers

Document that g_vasprintf and g_strdup_printf are guaranteed to return a
non-NULL string, unless the format string contains the locale sensitive
conversions %lc or %ls.

Further annotate that the output parameter for g_vasprintf and the
format string for all functions must be non-NULL.

Fixes #1622

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2019-10-04 15:04:01 +01:00
parent 14035010dd
commit 109be1e90d
3 changed files with 18 additions and 6 deletions

View File

@@ -1144,7 +1144,7 @@ g_string_up (GString *string)
/**
* g_string_append_vprintf:
* @string: a #GString
* @format: the string format. See the printf() documentation
* @format: (not nullable): the string format. See the printf() documentation
* @args: the list of arguments to insert in the output
*
* Appends a formatted string onto the end of a #GString.
@@ -1179,7 +1179,7 @@ g_string_append_vprintf (GString *string,
/**
* g_string_vprintf:
* @string: a #GString
* @format: the string format. See the printf() documentation
* @format: (not nullable): the string format. See the printf() documentation
* @args: the parameters to insert into the format string
*
* Writes a formatted string into a #GString.