From: Karl Williamson Date: Sat, 6 Apr 2013 18:53:07 +0000 (-0600) Subject: utf8.c: Don't do ++ in macro parameter X-Git-Tag: upstream/5.20.0~2089^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a91c45dafa351df09ab053d5366a6d6fe31e565;p=platform%2Fupstream%2Fperl.git utf8.c: Don't do ++ in macro parameter The formal parameter gets evaluated multiple times on an EBCDIC platform, thus incrementing more than the intended once. --- diff --git a/utf8.c b/utf8.c index 1570fc8..64da27d 100644 --- a/utf8.c +++ b/utf8.c @@ -1335,9 +1335,10 @@ Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *len, bool *is_utf8) s = start; start = d; while (s < send) { U8 c = *s++; - if (!UTF8_IS_INVARIANT(c)) { + if (! UTF8_IS_INVARIANT(c)) { /* Then it is two-byte encoded */ - c = TWO_BYTE_UTF8_TO_NATIVE(c, *s++); + c = TWO_BYTE_UTF8_TO_NATIVE(c, *s); + s++; } *d++ = c; }