summaryrefslogtreecommitdiffstats
path: root/generic/tclScan.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-04-12 13:14:38 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-04-12 13:14:38 (GMT)
commitbc97ae8a02bb8363f85b25501b9aa125c5b344cd (patch)
treee4149c73b615c2886e35455ee241acb660602cf9 /generic/tclScan.c
parent155377a13fc942edef1524383465f2aa0efd92c2 (diff)
downloadtcl-bc97ae8a02bb8363f85b25501b9aa125c5b344cd.zip
tcl-bc97ae8a02bb8363f85b25501b9aa125c5b344cd.tar.gz
tcl-bc97ae8a02bb8363f85b25501b9aa125c5b344cd.tar.bz2
Revert recent commit [80252e0aed]. TIP 237 is clear that %llu is invalid.
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r--generic/tclScan.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 5ea7e46..3edb8be 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -10,7 +10,6 @@
*/
#include "tclInt.h"
-#include "tommath.h"
/*
* Flag values used by Tcl_ScanObjCmd.
@@ -416,7 +415,14 @@ ValidateFormat(
case 'x':
case 'X':
case 'b':
+ break;
case 'u':
+ if (flags & SCAN_BIG) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "unsigned bignum scans are invalid", -1));
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADUNSIGNED",NULL);
+ goto error;
+ }
break;
/*
* Bracket terms need special checking
@@ -930,18 +936,7 @@ Tcl_ScanObjCmd(
} else {
Tcl_SetWideIntObj(objPtr, wideValue);
}
- } else if (flags & SCAN_BIG) {
- if (flags & SCAN_UNSIGNED) {
- mp_int big;
- if ((Tcl_GetBignumFromObj(interp, objPtr, &big) != TCL_OK)
- || (mp_cmp_d(&big, 0) == MP_LT)) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "unsigned bignum scans are invalid", -1));
- Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADUNSIGNED",NULL);
- return TCL_ERROR;
- }
- }
- } else {
+ } else if (!(flags & SCAN_BIG)) {
if (TclGetLongFromObj(NULL, objPtr, &value) != TCL_OK) {
if (TclGetString(objPtr)[0] == '-') {
value = LONG_MIN;