summaryrefslogtreecommitdiffstats
path: root/generic/tclBinary.c
diff options
context:
space:
mode:
authorstwo <stwo>2012-09-16 15:56:02 (GMT)
committerstwo <stwo>2012-09-16 15:56:02 (GMT)
commit4cbd189c26149481fffd935920221b8e3a0c7b2e (patch)
tree1e582d8fef984892f52d67c874aa0294faf872b5 /generic/tclBinary.c
parenta691e3e94617652a15c76afc630e9869cd7ae6cd (diff)
downloadtcl-4cbd189c26149481fffd935920221b8e3a0c7b2e.zip
tcl-4cbd189c26149481fffd935920221b8e3a0c7b2e.tar.gz
tcl-4cbd189c26149481fffd935920221b8e3a0c7b2e.tar.bz2
Nicer style test.
Diffstat (limited to 'generic/tclBinary.c')
-rw-r--r--generic/tclBinary.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 8c95305..d3b11d3 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -279,10 +279,10 @@ Tcl_SetByteArrayObj(
byteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr->used = length;
byteArrayPtr->allocated = length;
- if (length && bytes) {
+
+ if ((length != NULL) && (bytes > 0)) {
memcpy(byteArrayPtr->bytes, bytes, (size_t) length);
}
-
objPtr->typePtr = &tclByteArrayType;
SET_BYTEARRAY(objPtr, byteArrayPtr);
}