diff options
author | Bryce Harrington <bryce@osg.samsung.com> | 2016-07-08 16:51:16 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2016-07-11 14:00:34 -0700 |
commit | c88ec7e2914a5b85fd878e4ee96f31aa26be05c8 (patch) | |
tree | 1a8755704f3c19016119775a003509e4c14e7f59 | |
parent | 1cda73f3f85514ef18f180d350e1e390ff388f10 (diff) |
scanner: Improve documentation for strtouint()
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
-rw-r--r-- | src/scanner.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/scanner.c b/src/scanner.c index 4708cae..6e2c3a3 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. + * + * Upon error, this routine does not modify or set errno. + * + * \returns -1 on error, or a non-negative integer on success + */ static int strtouint(const char *str) { |