summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-01 11:20:52 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-01 11:20:52 (GMT)
commit6b83d829a89a6bd022138f88ff25afca45fdeb2c (patch)
tree7e39c92c8ad974060b61254b0f1b803f9e8e6094 /generic/tclStringObj.c
parente3c877712883c1dadd287aa7b97ee0f4989a8890 (diff)
downloadtcl-6b83d829a89a6bd022138f88ff25afca45fdeb2c.zip
tcl-6b83d829a89a6bd022138f88ff25afca45fdeb2c.tar.gz
tcl-6b83d829a89a6bd022138f88ff25afca45fdeb2c.tar.bz2
More internal use of size_t. Eliminate unused "isBin" argument from TclpSysAlloc()
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index b259df7..1fc0aa5 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2708,9 +2708,11 @@ TclStringRepeat(
if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) {
if (interp) {
+ char buf[TCL_INTEGER_SPACE];
+ sprintf(buf, "%" TCL_LL_MODIFIER "u", (Tcl_WideInt)STRING_SIZE(count*length));
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "string size overflow: unable to alloc %lu bytes",
- STRING_SIZE(count*length)));
+ "string size overflow: unable to alloc %s bytes",
+ buf));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
@@ -2931,9 +2933,11 @@ TclStringCatObjv(
Tcl_InvalidateStringRep(objResultPtr);
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
if (interp) {
+ char buf[TCL_INTEGER_SPACE];
+ sprintf(buf, "%" TCL_LL_MODIFIER "u", (Tcl_WideInt)STRING_SIZE(length));
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "concatenation failed: unable to alloc %lu bytes",
- STRING_SIZE(length)));
+ "concatenation failed: unable to alloc %s bytes",
+ buf));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
@@ -2946,9 +2950,11 @@ TclStringCatObjv(
objResultPtr = Tcl_NewUnicodeObj(&ch, 0); /* PANIC? */
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
if (interp) {
+ char buf[TCL_INTEGER_SPACE];
+ sprintf(buf, "%" TCL_LL_MODIFIER "u", (Tcl_WideInt)STRING_SIZE(length));
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "concatenation failed: unable to alloc %lu bytes",
- STRING_SIZE(length)));
+ "concatenation failed: unable to alloc %s bytes",
+ buf));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;