Diff
Not logged in

Differences From Artifact [d138bcdb56]:

To Artifact [5331e1701e]:


376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
376
377
378
379
380
381
382

383
384
385
386
387
388
389







-







    baPtr = GET_BYTEARRAY(irPtr);

    if (numBytesPtr != NULL) {
	*numBytesPtr = baPtr->used;
    }
    return baPtr->bytes;
}


/*
 *----------------------------------------------------------------------
 *
 * Tcl_SetByteArrayLength --
 *
 *	This procedure changes the length of the byte array for this object.
476
477
478
479
480
481
482
483

484
485
486
487
488
489
490
475
476
477
478
479
480
481

482
483
484
485
486
487
488
489







-
+







    unsigned char *dst = byteArrayPtr->bytes;
    unsigned char *dstEnd = dst + numBytes;
    const char *srcEnd = src + length;
    int proper = 1;

    for (; src < srcEnd && dst < dstEnd; ) {
	int ch;
	int count = Tcl_UtfToUniChar(src, &ch);
	int count = TclUtfToUniChar(src, &ch);

	if (ch > 255) {
	    proper = 0;
	    if (demandProper) {
		if (interp) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			    "expected byte sequence but character %"