diff options
| -rw-r--r-- | generic/tclInt.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index d40bbe5..7114d66 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4516,9 +4516,9 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, TclInitEmptyStringRep(objPtr) \ ) : ( \ (objPtr)->bytes = (char *)attemptckalloc((len) + 1U), \ - memcpy((objPtr)->bytes, (bytePtr) ? (bytePtr) : &tclEmptyString, (len)), \ - (objPtr)->bytes[len] = '\0', \ - (objPtr)->length = (len) \ + (objPtr)->length = ((objPtr)->bytes) ? \ + (memcpy((objPtr)->bytes, (bytePtr) ? (bytePtr) : &tclEmptyString, (len)), \ + (objPtr)->bytes[len] = '\0', (len)) : (-1) \ )), (objPtr)->bytes) /* |
