summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-04-20 06:15:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-04-20 06:15:55 (GMT)
commit3d3574a29acb65e49229c127cff1e875d7977c91 (patch)
tree5a7f5ba1d04a2a3b12b0d8dd0b9f2468cd7eafe0 /generic/tclStringObj.c
parent3d42a8913e2e9598c4a6aeba195d14261826b7c7 (diff)
parentd48b6bfcd6c717eca2710e41f09129ab78b2a20f (diff)
downloadtcl-tip_312.zip
tcl-tip_312.tar.gz
tcl-tip_312.tar.bz2
merge trunktip_312
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index e51b98a..7c898b7 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -1939,6 +1939,11 @@ Tcl_AppendFormatToObj(
}
case 'u':
+ if (useBig) {
+ msg = "unsigned bignum format is invalid";
+ errCode = "BADUNSIGNED";
+ goto errorMsg;
+ }
case 'd':
case 'o':
case 'p':
@@ -1962,15 +1967,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) {
@@ -2784,7 +2780,7 @@ TclStringRepeat(
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"string size overflow: unable to alloc %"
- TCL_LL_MODIFIER "u bytes",
+ TCL_LL_MODIFIER "d bytes",
(Tcl_WideUInt)STRING_SIZE(count*length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
@@ -3008,7 +3004,7 @@ TclStringCatObjv(
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"concatenation failed: unable to alloc %"
- TCL_LL_MODIFIER "u bytes",
+ TCL_LL_MODIFIER "d bytes",
(Tcl_WideUInt)STRING_SIZE(length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
@@ -3024,7 +3020,7 @@ TclStringCatObjv(
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"concatenation failed: unable to alloc %"
- TCL_LL_MODIFIER "u bytes",
+ TCL_LL_MODIFIER "d bytes",
(Tcl_WideUInt)STRING_SIZE(length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}