summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-09-17 12:26:06 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-09-17 12:26:06 (GMT)
commit9a1e05642daa7aaeddbac912094ac5caedb797f7 (patch)
tree17765f5a0b5ac0c01d726739b865dc1f6d0b794b /generic
parentd25924729fd7ab6a77584dcca40120ac182140f3 (diff)
parentb010f2f6d941bf70ee1512bcf70c3a4714dcf996 (diff)
downloadtcl-9a1e05642daa7aaeddbac912094ac5caedb797f7.zip
tcl-9a1e05642daa7aaeddbac912094ac5caedb797f7.tar.gz
tcl-9a1e05642daa7aaeddbac912094ac5caedb797f7.tar.bz2
merge trunk
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBinary.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 4953e27..3d8b24c 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -309,10 +309,10 @@ Tcl_SetByteArrayObj(
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr->used = length;
byteArrayPtr->allocated = length;
- if (length && bytes) {
+
+ if ((bytes != NULL) && (length > 0)) {
memcpy(byteArrayPtr->bytes, bytes, (size_t) length);
}
-
objPtr->typePtr = &tclByteArrayType;
SET_BYTEARRAY(objPtr, byteArrayPtr);
}