summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-02-09 15:23:09 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-02-09 15:23:09 (GMT)
commit585e9d3a4bed8f40ed559193675115a240552c2d (patch)
treef5546f1b21e0ee576ecfd76cf8d5202628dce41c /generic/tclStringObj.c
parentc24d7161999195800c8c642c949d60bf0fbd0fe7 (diff)
parent1282ebeb8db26665851fd4aad9c31e0d2e7bd7e0 (diff)
downloadtcl-585e9d3a4bed8f40ed559193675115a240552c2d.zip
tcl-585e9d3a4bed8f40ed559193675115a240552c2d.tar.gz
tcl-585e9d3a4bed8f40ed559193675115a240552c2d.tar.bz2
Converted the memcpy() calls in append operations to memmove() calls.
This adds safety in the case of overlapping copies, and improves performance on some benchmarks.
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index d721c47..04cf4ee 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -1437,7 +1437,7 @@ AppendUnicodeToUnicodeRep(
* trailing null.
*/
- memcpy(stringPtr->unicode + stringPtr->numChars, unicode,
+ memmove(stringPtr->unicode + stringPtr->numChars, unicode,
appendNumChars * sizeof(Tcl_UniChar));
stringPtr->unicode[numChars] = 0;
stringPtr->numChars = numChars;
@@ -1605,7 +1605,7 @@ AppendUtfToUtfRep(
stringPtr->numChars = -1;
stringPtr->hasUnicode = 0;
- memcpy(objPtr->bytes + oldLength, bytes, numBytes);
+ memmove(objPtr->bytes + oldLength, bytes, numBytes);
objPtr->bytes[newLength] = 0;
objPtr->length = newLength;
}