diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-11-25 10:16:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-11-25 10:16:35 (GMT) |
commit | 7bf0253a4354d176c6582cd6f4ed02434e6c4797 (patch) | |
tree | c192192966d0ad2b30ba68914386d7e209af9028 /generic/tclBinary.c | |
parent | 826db93d76965d85df64187e05ec05095a6eae56 (diff) | |
parent | 73116e2c54973fea6efc412b979d78999df3a08a (diff) | |
download | tcl-7bf0253a4354d176c6582cd6f4ed02434e6c4797.zip tcl-7bf0253a4354d176c6582cd6f4ed02434e6c4797.tar.gz tcl-7bf0253a4354d176c6582cd6f4ed02434e6c4797.tar.bz2 |
Merge 9.0
Diffstat (limited to 'generic/tclBinary.c')
-rw-r--r-- | generic/tclBinary.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 975b8e6..a6c2065 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -530,7 +530,7 @@ MakeByteArray( return proper; } -Tcl_Obj * +static Tcl_Obj * TclNarrowToBytes( Tcl_Obj *objPtr) { @@ -912,9 +912,9 @@ BinaryFormatCmd( goto badIndex; } if (count == BINARY_ALL) { - Tcl_Obj *copy = TclNarrowToBytes(objv[arg]); - (void)Tcl_GetByteArrayFromObj(copy, &count); - Tcl_DecrRefCount(copy); + if (Tcl_GetByteArrayFromObj(objv[arg], &count) == NULL) { + count = Tcl_GetCharLength(objv[arg]); + } } else if (count == BINARY_NOCOUNT) { count = 1; } @@ -2524,7 +2524,7 @@ BinaryDecodeHex( } TclNewObj(resultObj); - data = Tcl_GetBytesFromObj(NULL, objv[objc - 1], &count); + data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count); if (data == NULL) { pure = 0; data = (unsigned char *) Tcl_GetStringFromObj(objv[objc - 1], &count); @@ -2657,7 +2657,7 @@ BinaryEncode64( } break; case OPT_WRAPCHAR: - wrapchar = (const char *)Tcl_GetBytesFromObj(NULL, + wrapchar = (const char *)Tcl_GetByteArrayFromObj( objv[i + 1], &wrapcharlen); if (wrapchar == NULL) { purewrap = 0; @@ -2928,7 +2928,7 @@ BinaryDecodeUu( } TclNewObj(resultObj); - data = Tcl_GetBytesFromObj(NULL, objv[objc - 1], &count); + data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count); if (data == NULL) { pure = 0; data = (unsigned char *) Tcl_GetStringFromObj(objv[objc - 1], &count); @@ -3103,7 +3103,7 @@ BinaryDecode64( } TclNewObj(resultObj); - data = Tcl_GetBytesFromObj(NULL, objv[objc - 1], &count); + data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count); if (data == NULL) { pure = 0; data = (unsigned char *) Tcl_GetStringFromObj(objv[objc - 1], &count); |