[PATCH] scanner: Improve documentation for strtouint()

Bryce Harrington bryce at osg.samsung.com
Fri Jul 8 23:51:16 UTC 2016


From: Bryce Harrington <bryce at bryceharrington.org>

Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
Signed-off-by: Bryce Harrington <bryce at bryceharrington.org>
---
 src/scanner.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/scanner.c b/src/scanner.c
index 4708cae..a266da1 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -576,8 +576,17 @@ free_interface(struct interface *interface)
 	free(interface);
 }
 
-/* convert string to unsigned integer,
- * in the case of error, return -1 */
+/** Convert string to unsigned integer
+ *
+ * Parses a non-negative base-10 number from the given string.  If the
+ * specified string is blank, contains non-numerical characters, is out
+ * of range, or results in a negative number, -1 is returned to indicate
+ * an error..
+ *
+ * This routine does not modify errno, nor sets errno on error.
+ *
+ * \returns -1 on error, or a non-negative integer on success
+ */
 static int
 strtouint(const char *str)
 {
-- 
1.9.1



More information about the wayland-devel mailing list