diff options
author | Erlang/OTP <[email protected]> | 2010-06-08 10:04:13 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-06-08 10:04:13 +0000 |
commit | b10f0358c5286300dc9c861c6d45a10222bba3c2 (patch) | |
tree | 3b33280f378b2378aee633a85dad17ce530c91b3 /erts/emulator/test/nif_SUITE_data/nif_SUITE.c | |
parent | 5a5a5013c1a8a53955f6d6bca2daf36838099b6a (diff) | |
parent | 8215a7a3eea8f36532ceac31e48fbc6337cb9a8b (diff) | |
download | otp-b10f0358c5286300dc9c861c6d45a10222bba3c2.tar.gz otp-b10f0358c5286300dc9c861c6d45a10222bba3c2.tar.bz2 otp-b10f0358c5286300dc9c861c6d45a10222bba3c2.zip |
Merge branch 'pg/fix_erts_bld_string_n' into dev
* pg/fix_erts_bld_string_n:
Fix erts_bld_string_n (called by enif_make_string and erlang:decode_packet/3) to work with 8 bits characters
OTP-8685 pg/fix_erts_bld_string_n
Fix bug causing erlang:decode_packet and enif_make_string to generate
faulty strings with negative character values for ascii values larger than
127. (Thanks to Paul Guyot)
Diffstat (limited to 'erts/emulator/test/nif_SUITE_data/nif_SUITE.c')
-rw-r--r-- | erts/emulator/test/nif_SUITE_data/nif_SUITE.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c index bacf7845e2..c8cd323b7e 100644 --- a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c +++ b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c @@ -808,12 +808,14 @@ static ERL_NIF_TERM make_strings(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar { const char a0string[8] = {'a','0','s','t','r','i','n','g'}; const char a0string0[9] = {'a','\0','s','t','r','i','n','g',0}; + const char astringwith8bits[37] = {'E','r','l','a','n','g',' ',0xE4 /* 'ä' */,'r',' ','e','t','t',' ','g','e','n','e','r','e','l','l','t',' ','p','r','o','g','r','a','m','s','p','r', 0xE5 /* 'å' */,'k',0}; - return enif_make_tuple4(env, + return enif_make_tuple5(env, enif_make_string(env, "a0string", ERL_NIF_LATIN1), enif_make_string_len(env, "a0string", 8, ERL_NIF_LATIN1), enif_make_string_len(env, a0string, 8, ERL_NIF_LATIN1), - enif_make_string_len(env, a0string0, 9, ERL_NIF_LATIN1)); + enif_make_string_len(env, a0string0, 9, ERL_NIF_LATIN1), + enif_make_string(env, astringwith8bits, ERL_NIF_LATIN1)); } static ERL_NIF_TERM send_list_seq(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) { |