summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/strtol.c
Commit message (Collapse)AuthorAgeFilesLines
* Portability fix: use unsigned cast to guaranteed positive part of expressionache2001-09-041-1/+1
| | | | | in case {L}LONG_MAX > abs({L}LONG_MIN). Non-functional change - we don't have any such platforms.
* Remove rcsids and unneded includeache2001-09-041-5/+2
|
* 'acc' is not initialized in one hypotetical case, fix itache2001-09-041-2/+2
|
* Locale *is* used in strto*l*(), at least for isspace(), so removeache2001-09-041-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'locale not used' statement from comments and BUGS section of manpage. strtol(): fix non-portable 'cutoff' calculation using the same method as in strtoll(). Cleanup 'cutoff' calculation, remove unneded casts. Misc. cleanup to make all functions looks the same. Implement EINVAL reaction per POSIX, document it in manpage, corresponding POSIX example quotes here: ------------------------------------------------ If the subject sequence is empty or does not have the expected form, no conversion is performed; the value of str is stored in the object pointed to by endptr, provided that endptr is not a null pointer. If no conversion could be performed, 0 shall be returned and errno may be set to [EINVAL]. [EINVAL] The value of base is not supported. Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are returned on error and are also valid returns on success, an application wishing to check for error situations should set errno to 0, then call strtol( ) or strtoll ( ), then check errno. -----------------------------------------------------
* General -Wall warning cleanup, part I.jkh1996-07-121-1/+1
| | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu>
* strtol and atoi VERY broken in 8bit chars locale, i.e. if you pass somethingache1995-08-011-1/+3
| | | | | | like 38400<any 8bit char, isalpha> it not detect this stuff and produce very big number instead. Fixed by operating with unsigned char and checking for isascii. (secure/telnetd hits by it f.e.)
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+129
OpenPOWER on IntegriCloud