summaryrefslogtreecommitdiffstats
path: root/generic/tclBinary.c
diff options
context:
space:
mode:
authorstwo <stwo>2012-09-16 15:51:55 (GMT)
committerstwo <stwo>2012-09-16 15:51:55 (GMT)
commita75ca077a703e4cf5d543f0af3335c05a6ffb657 (patch)
treedea30e5ade8cbefcc5ddfa6fea1ded345b13976b /generic/tclBinary.c
parent3c125234b71311177388b04aea13513e785b6a14 (diff)
downloadtcl-a75ca077a703e4cf5d543f0af3335c05a6ffb657.zip
tcl-a75ca077a703e4cf5d543f0af3335c05a6ffb657.tar.gz
tcl-a75ca077a703e4cf5d543f0af3335c05a6ffb657.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 4953e27..cbd9b02 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 ((length != NULL) && (bytes > 0)) {
memcpy(byteArrayPtr->bytes, bytes, (size_t) length);
}
-
objPtr->typePtr = &tclByteArrayType;
SET_BYTEARRAY(objPtr, byteArrayPtr);
}