diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-12 15:03:58 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-12 15:03:58 +0000 |
commit | c638b697499e3d6f006463304b34efb0ca2bfa95 (patch) | |
tree | ab40a52541c5343ce81a232e4b5886f7d4e994af /utf8.c | |
parent | e1c446056ed0878bf6deb2084482fb1f1bdae94e (diff) | |
download | perl-c638b697499e3d6f006463304b34efb0ca2bfa95.tar.gz |
EBCDIC: another "can't happen".
p4raw-id: //depot/perl@14660
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |