Fix unhandled exceptions with unicode error messages (#2994)

Fixes #2993

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
This commit is contained in:
Dániel Bátyai authored and Robert Fancsik committed 2019-07-30 19:48:56 +02:00
1 parent a2d242eab9
commit dfafb1aa6b
7 files changed
+28 -13

No files matched your search

+4 -4
View File
@@ -55,7 +55,7 @@ DELCARE_HANDLER(print) {
{
if (jerry_value_is_string (args_p[cc]))
{
jerry_size_t size = jerry_get_string_size (args_p[0]);
jerry_size_t size = jerry_get_utf8_string_size (args_p[0]);
char *buffer;
buffer = (char *) malloc(size + 1);
@@ -66,9 +66,9 @@ DELCARE_HANDLER(print) {
continue;
}
jerry_string_to_char_buffer (args_p[cc],
(jerry_char_t *) buffer,
size);
jerry_string_to_utf8_char_buffer (args_p[cc],
(jerry_char_t *) buffer,
size);
*(buffer + size) = 0;
printf("%s ", buffer);
free (buffer);