From 96acb49eb176fd1f978612020970f232d697b405 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 4 Dec 2018 12:52:44 +0000 Subject: [PATCH] gstrfuncs: Clarify that g_ascii_string_to_unsigned() rejects signs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unlike g_ascii_strtoull(), g_ascii_string_to_unsigned() does not permit leading signs (`+` or `-`). Document that. It’s already in the unit tests. Signed-off-by: Philip Withnall --- glib/gstrfuncs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index 4bde7dbd1..5a9ac884f 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -3309,7 +3309,8 @@ g_ascii_string_to_signed (const gchar *str, * @base that is within inclusive bounds limited by @min and @max. If * this is true, then the converted number is stored in @out_num. An * empty string is not a valid input. A string with leading or - * trailing whitespace is also an invalid input. + * trailing whitespace is also an invalid input. A string with a leading sign + * (`-` or `+`) is not a valid input for the unsigned parser. * * @base can be between 2 and 36 inclusive. Hexadecimal numbers must * not be prefixed with "0x" or "0X". Such a problem does not exist