Diff
Not logged in

Differences From Artifact [53a3075cdd]:

To Artifact [b4af5e5af0]:


659
660
661
662
663
664
665
666

667
668
669
670
671

672
673
674
675
676
677
678
659
660
661
662
663
664
665

666
667
668
669
670

671
672
673
674
675
676
677
678







-
+




-
+







    length = byteArrayPtr->used;

    /*
     * How much space will string rep need?
     */

    size = length;
    for (i = 0; (i < length) && (size != (size_t)-1); i++) {
    for (i = 0; (i < length) && (size != TCL_AUTO_LENGTH); i++) {
	if ((src[i] == 0) || (src[i] > 127)) {
	    size++;
	}
    }
    if (size == (size_t)-1) {
    if (size == TCL_AUTO_LENGTH) {
	Tcl_Panic("max size for a Tcl value exceeded");
    }

    dst = Tcl_Alloc(size + 1);
    objPtr->bytes = dst;
    objPtr->length = size;

714
715
716
717
718
719
720
721

722
723
724
725
726
727
728
714
715
716
717
718
719
720

721
722
723
724
725
726
727
728







-
+







{
    ByteArray *byteArrayPtr;
    size_t needed;

    if (Tcl_IsShared(objPtr)) {
	Tcl_Panic("%s called with shared object","TclAppendBytesToByteArray");
    }
    if (len == (size_t)-1) {
    if (len == TCL_AUTO_LENGTH) {
	Tcl_Panic("%s must be called with definite number of bytes to append",
		"TclAppendBytesToByteArray");
    }
    if (len == 0) {
	/* Append zero bytes is a no-op. */
	return;
    }