aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_unicode.c
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2013-01-22 17:20:17 +0100
committerSverker Eriksson <sverker@erlang.org>2013-01-22 19:34:03 +0100
commit8eb544073fe243a8935a54f83f9c9f1f7478e3c5 (patch)
treeef4c209a4a2799f844f9cde295d197ebcc0229b4 /erts/emulator/beam/erl_unicode.c
parent3aa60cc472bc330dbe9360eb27a1f340b7e23dc6 (diff)
downloadotp-8eb544073fe243a8935a54f83f9c9f1f7478e3c5.tar.gz
otp-8eb544073fe243a8935a54f83f9c9f1f7478e3c5.tar.bz2
otp-8eb544073fe243a8935a54f83f9c9f1f7478e3c5.zip
erts: Fix bug in analyze_utf8 causing faulty latin1 detection
Diffstat (limited to 'erts/emulator/beam/erl_unicode.c')
-rw-r--r--erts/emulator/beam/erl_unicode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_unicode.c b/erts/emulator/beam/erl_unicode.c
index c00293de89..883405d066 100644
--- a/erts/emulator/beam/erl_unicode.c
+++ b/erts/emulator/beam/erl_unicode.c
@@ -1180,13 +1180,13 @@ analyze_utf8(byte *source, Uint size, byte **err_pos, Uint *num_chars, int *left
((*source) < 0xC2) /* overlong */) {
return ERTS_UTF8_ERROR;
}
- source += 2;
- size -= 2;
if (num_latin1_chars) {
latin1_count++;
if ((source[0] & ((byte) 0xFC)) != ((byte) 0xC0))
is_latin1 = 0;
}
+ source += 2;
+ size -= 2;
} else if (((*source) & ((byte) 0xF0)) == 0xE0) {
if (size < 3) {
return ERTS_UTF8_INCOMPLETE;