[glib: 2/5] gstrfuncs: Clarify that g_ascii_string_to_unsigned() rejects signs
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/5] gstrfuncs: Clarify that g_ascii_string_to_unsigned() rejects signs
- Date: Thu, 6 Dec 2018 11:15:47 +0000 (UTC)
commit 96acb49eb176fd1f978612020970f232d697b405
Author: Philip Withnall <withnall endlessm com>
Date: Tue Dec 4 12:52:44 2018 +0000
gstrfuncs: Clarify that g_ascii_string_to_unsigned() rejects signs
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 <withnall endlessm com>
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]