summaryrefslogtreecommitdiffstats
path: root/compat/strtoul.c
diff options
context:
space:
mode:
authorkennykb <kennykb@noemail.net>2002-02-15 23:42:11 (GMT)
committerkennykb <kennykb@noemail.net>2002-02-15 23:42:11 (GMT)
commitfcffc703fd991f594e64d5ec676065a33c91bcc8 (patch)
tree87a231b742d00bcbf481e3439acb70032c612370 /compat/strtoul.c
parentafb5a69112019f2bde36ef53a9c4e79a0a021f77 (diff)
downloadtcl-fcffc703fd991f594e64d5ec676065a33c91bcc8.zip
tcl-fcffc703fd991f594e64d5ec676065a33c91bcc8.tar.gz
tcl-fcffc703fd991f594e64d5ec676065a33c91bcc8.tar.bz2
Further changes to the TIP 72 patch to make it compile under VC++
FossilOrigin-Name: ffd6a7d7738c855d3f78a3b416a52091432c6b02
Diffstat (limited to 'compat/strtoul.c')
-rw-r--r--compat/strtoul.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/compat/strtoul.c b/compat/strtoul.c
index 3b7918c..e31299d 100644
--- a/compat/strtoul.c
+++ b/compat/strtoul.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: strtoul.c,v 1.2 1998/09/14 18:39:45 stanton Exp $
+ * RCS: @(#) $Id: strtoul.c,v 1.3 2002/02/15 23:42:12 kennykb Exp $
*/
#include <ctype.h>
@@ -152,14 +152,14 @@ strtoul(string, endPtr, base)
result = (result << 4) + digit;
anyDigits = 1;
}
- } else {
+ } else if ( base >= 2 && base <= 36 ) {
for ( ; ; p += 1) {
digit = *p - '0';
if (digit > ('z' - '0')) {
break;
}
digit = cvtIn[digit];
- if (digit >= base) {
+ if (digit >= ( (unsigned) base )) {
break;
}
result = result*base + digit;