diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-10 19:36:45 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-10 19:36:45 +0200 |
commit | 1e4497515f13cf892de74cd8070d301c77e0390d (patch) | |
tree | 7bda231789a3ee152776429dd28ded212892d2ea /src/stdlib/atoi.c | |
parent | add atof (diff) | |
download | slibc-1e4497515f13cf892de74cd8070d301c77e0390d.tar.gz slibc-1e4497515f13cf892de74cd8070d301c77e0390d.tar.bz2 slibc-1e4497515f13cf892de74cd8070d301c77e0390d.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/stdlib/atoi.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/stdlib/atoi.c b/src/stdlib/atoi.c index bbb87c3..9c45803 100644 --- a/src/stdlib/atoi.c +++ b/src/stdlib/atoi.c @@ -24,10 +24,11 @@ * Convert a string to an integer, * without checking for errors. * - * Note that, the behaviour is unspecified - * if the string contains anything else than - * digits and either a leading '-' (hyphen) - * or a leading plus. + * The string may being with an arbitrary number + * of whitespace characters. Convertion will end + * when a character is encountered that is not a + * decimal digit, and is not an absolutely leading + * '-' or '+'. * * @param string The string to convert. * @return The integer encoded by the string. @@ -42,10 +43,11 @@ int atoi(const char* string) * Convert a string to an integer, * without checking for errors. * - * Note that, the behaviour is unspecified - * if the string contains anything else than - * digits and either a leading '-' (hyphen) - * or a leading plus. + * The string may being with an arbitrary number + * of whitespace characters. Convertion will end + * when a character is encountered that is not a + * decimal digit, and is not an absolutely leading + * '-' or '+'. * * @param string The string to convert. * @return The integer encoded by the string. @@ -75,10 +77,11 @@ long int atol(const char* string) * Convert a string to an integer, * without checking for errors. * - * Note that, the behaviour is unspecified - * if the string contains anything else than - * digits and either a leading '-' (hyphen) - * or a leading plus. + * The string may being with an arbitrary number + * of whitespace characters. Convertion will end + * when a character is encountered that is not a + * decimal digit, and is not an absolutely leading + * '-' or '+'. * * @param string The string to convert. * @return The integer encoded by the string. |