summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 6cce073..4e19750 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -1943,6 +1943,11 @@ Tcl_AppendFormatToObj(
}
case 'u':
+ if (useBig) {
+ msg = "unsigned bignum format is invalid";
+ errCode = "BADUNSIGNED";
+ goto errorMsg;
+ }
case 'd':
case 'o':
case 'x':
@@ -1960,15 +1965,6 @@ Tcl_AppendFormatToObj(
goto error;
}
isNegative = (mp_cmp_d(&big, 0) == MP_LT);
- if (ch == 'u') {
- if (isNegative) {
- msg = "unsigned bignum format is invalid";
- errCode = "BADUNSIGNED";
- goto errorMsg;
- } else {
- ch = 'd';
- }
- }
#ifndef TCL_WIDE_INT_IS_LONG
} else if (useWide) {
if (Tcl_GetWideIntFromObj(NULL, segment, &w) != TCL_OK) {