diff options
author | Sverker Eriksson <[email protected]> | 2013-01-23 16:04:38 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-01-23 16:04:38 +0100 |
commit | c596e17cf3d69cf5e10d28ee2a8ee35162786da1 (patch) | |
tree | 19188850b49cfcb8b3d0c2e720947fc105609b24 /lib/erl_interface/src/legacy/erl_marshal.c | |
parent | 5d2aaef89f2e1dce2147ac56a105f129390f31a3 (diff) | |
download | otp-c596e17cf3d69cf5e10d28ee2a8ee35162786da1.tar.gz otp-c596e17cf3d69cf5e10d28ee2a8ee35162786da1.tar.bz2 otp-c596e17cf3d69cf5e10d28ee2a8ee35162786da1.zip |
erl_interface: Changed erlang_char_encoding interface
to allow bitwise-or'd combinations.
Diffstat (limited to 'lib/erl_interface/src/legacy/erl_marshal.c')
-rw-r--r-- | lib/erl_interface/src/legacy/erl_marshal.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |