From c596e17cf3d69cf5e10d28ee2a8ee35162786da1 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 23 Jan 2013 16:04:38 +0100 Subject: erl_interface: Changed erlang_char_encoding interface to allow bitwise-or'd combinations. --- lib/erl_interface/src/legacy/erl_marshal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/erl_interface/src/legacy/erl_marshal.c') diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c index 884e9d421b..4c45cebb02 100644 --- a/lib/erl_interface/src/legacy/erl_marshal.c +++ b/lib/erl_interface/src/legacy/erl_marshal.c @@ -662,7 +662,7 @@ static int read_atom(unsigned char** ext, Erl_Atom_data* a) int offs = 0; enum erlang_char_encoding enc; int ret = ei_decode_atom_as((char*)*ext, &offs, buf, MAXATOMLEN_UTF8, - ERLANG_WHATEVER, NULL, &enc); + ERLANG_LATIN1|ERLANG_UTF8, NULL, &enc); *ext += offs; if (ret == 0) { @@ -674,11 +674,11 @@ static int read_atom(unsigned char** ext, Erl_Atom_data* a) a->lenL = 0; a->utf8 = NULL; a->lenU = 0; - if (enc == ERLANG_LATIN1 || enc == ERLANG_ASCII) { + if (enc & (ERLANG_LATIN1 | ERLANG_ASCII)) { a->latin1 = clone; a->lenL = i; } - if (enc == ERLANG_UTF8 || enc == ERLANG_ASCII) { + if (enc & (ERLANG_UTF8 | ERLANG_ASCII)) { a->utf8 = clone; a->lenU = i; } -- cgit v1.2.3