diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-04-06 12:53:07 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-08-29 09:56:05 -0600 |
commit | 1a91c45dafa351df09ab053d5366a6d6fe31e565 (patch) | |
tree | c79597909c56cb6767d2161f28e3788222cf4ccc /utf8.c | |
parent | d59937ca545474202762c5f39f6a16b12193950f (diff) | |
download | perl-1a91c45dafa351df09ab053d5366a6d6fe31e565.tar.gz |
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.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |