diff options
author | Sverker Eriksson <[email protected]> | 2017-07-06 15:07:34 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-07-06 15:07:34 +0200 |
commit | f0715ae80670b12f4120f2b9d3b7bd51be690ea8 (patch) | |
tree | ba814144949cd31c4022e1b307155c87f69a9e02 /erts/emulator/beam/bif.c | |
parent | df3442b0eb1ec4c6f8f4547cc20e5ad0824e7cd5 (diff) | |
download | otp-f0715ae80670b12f4120f2b9d3b7bd51be690ea8.tar.gz otp-f0715ae80670b12f4120f2b9d3b7bd51be690ea8.tar.bz2 otp-f0715ae80670b12f4120f2b9d3b7bd51be690ea8.zip |
erts: Generate crash_dump slogan string as UTF8
the same as atoms.
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r-- | erts/emulator/beam/bif.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index 8380efaf13..8bf7e3926e 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -3971,9 +3971,6 @@ BIF_RETTYPE display_nl_0(BIF_ALIST_0) /**********************************************************************/ -#define HALT_MSG_SIZE 200 -static char halt_msg[HALT_MSG_SIZE+1]; - /* stop the system with exit code and flags */ BIF_RETTYPE halt_2(BIF_ALIST_2) { @@ -4024,15 +4021,16 @@ BIF_RETTYPE halt_2(BIF_ALIST_2) erts_exit(ERTS_ABORT_EXIT, ""); } else if (is_string(BIF_ARG_1) || BIF_ARG_1 == NIL) { - Sint i; +# define HALT_MSG_SIZE 200 + static byte halt_msg[4*HALT_MSG_SIZE+1]; + Sint written; - if ((i = intlist_to_buf(BIF_ARG_1, halt_msg, HALT_MSG_SIZE)) == -1) { + if (erts_unicode_list_to_buf(BIF_ARG_1, halt_msg, HALT_MSG_SIZE, + &written) == -1 ) { goto error; } - if (i == -2) /* truncated string */ - i = HALT_MSG_SIZE; - ASSERT(i >= 0 && i <= HALT_MSG_SIZE); - halt_msg[i] = '\0'; + ASSERT(written >= 0 && written < sizeof(halt_msg)); + halt_msg[written] = '\0'; VERBOSE(DEBUG_SYSTEM, ("System halted by BIF halt(%T, %T)\n", BIF_ARG_1, BIF_ARG_2)); erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN); |