diff options
author | dgp <dgp@noemail.net> | 2002-02-24 02:53:25 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2002-02-24 02:53:25 (GMT) |
commit | 6294611c5b843c4d736d0c7cc09fb1848dc0460b (patch) | |
tree | 6218488a2214453fe2c2ddca22777e70958184f2 /compat/strtoll.c | |
parent | 82ed341aa0011feffa807bca53eee217809e4dc5 (diff) | |
download | tcl-6294611c5b843c4d736d0c7cc09fb1848dc0460b.zip tcl-6294611c5b843c4d736d0c7cc09fb1848dc0460b.tar.gz tcl-6294611c5b843c4d736d0c7cc09fb1848dc0460b.tar.bz2 |
* compat/strtoull.c (strtoull):
* compat/strtoll.c (strtoll):
* compat/strtoul.c (strtoul): Fixed failure to handle leading
sign symbols '+' and '-' and '0X' and raise overflow errors.
[Bug 440916] Also corrects prototype and errno problems.
FossilOrigin-Name: dbcccf04b63e6850b697cf29d508e60ce0889daa
Diffstat (limited to 'compat/strtoll.c')
-rw-r--r-- | compat/strtoll.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compat/strtoll.c b/compat/strtoll.c index 2ae6b0a..ca00fd0 100644 --- a/compat/strtoll.c +++ b/compat/strtoll.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: strtoll.c,v 1.4 2002/02/22 09:04:48 dkf Exp $ + * RCS: @(#) $Id: strtoll.c,v 1.5 2002/02/24 02:53:25 dgp Exp $ */ #include "tcl.h" @@ -22,7 +22,7 @@ /* *---------------------------------------------------------------------- * - * strtol -- + * strtoll -- * * Convert an ASCII string into an integer. * @@ -39,7 +39,11 @@ *---------------------------------------------------------------------- */ +#if TCL_WIDE_INT_IS_LONG +long long +#else Tcl_WideInt +#endif strtoll(string, endPtr, base) CONST char *string; /* String of ASCII digits, possibly * preceded by white space. For bases @@ -72,6 +76,7 @@ strtoll(string, endPtr, base) * Check for a sign. */ + errno = 0; if (*p == '-') { p += 1; uwResult = strtoull(p, endPtr, base); |