From: Jarkko Hietaniemi Date: Tue, 12 Feb 2002 15:03:58 +0000 (+0000) Subject: EBCDIC: another "can't happen". X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c638b697499e3d6f006463304b34efb0ca2bfa95;p=p5sagit%2Fp5-mst-13.2.git EBCDIC: another "can't happen". p4raw-id: //depot/perl@14660 --- diff --git a/utf8.c b/utf8.c index 2afcbeb..6c9cebd 100644 --- a/utf8.c +++ b/utf8.c @@ -1323,7 +1323,11 @@ Perl_to_utf8_case(pTHX_ U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, char *norma for (t = ustrp, tend = t + *lenp; t < tend; t += tlen) { UV c = utf8_to_uvchr(t, &tlen); - d = uvchr_to_utf8(d, UNI_TO_NATIVE(c)); + + if (tlen > 0) + d = uvchr_to_utf8(d, UNI_TO_NATIVE(c)); + else + break; } *lenp = d - tmpbuf; Copy(tmpbuf, ustrp, *lenp, U8);