summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-04-06 12:53:07 -0600
committerKarl Williamson <public@khwilliamson.com>2013-08-29 09:56:05 -0600
commit1a91c45dafa351df09ab053d5366a6d6fe31e565 (patch)
treec79597909c56cb6767d2161f28e3788222cf4ccc /utf8.c
parentd59937ca545474202762c5f39f6a16b12193950f (diff)
downloadperl-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/utf8.c b/utf8.c
index 1570fc80f0..64da27db1d 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;
}