Fix problems arising from incorrect use of various size types
E.g., * `ssize_t` was used where `lit_utf8_size_t` or `jerry_api_size_t` would have been correct, * `lit_utf8_size_t` was used where `ecma_length_t` would have been correct. Note, the patch also includes internal and public API changes: * `ecma_string_to_utf8_string` does not return negative value if output buffer is not large enough to contain the string; the buffer is expected to be large enough. (`ecma_string_get_size` can be used to retrieve the required size.) * `jerry_api_string_to_char_buffer` adapts the same logic (and `jerry_api_get_string_size` can be used to determine the required size of the buffer). Related issue: #942 JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
@@ -62,6 +62,6 @@ extern bool lit_compare_utf8_string_and_magic_string (const lit_utf8_byte_t *, l
|
||||
extern bool lit_compare_utf8_string_and_magic_string_ex (const lit_utf8_byte_t *, lit_utf8_size_t,
|
||||
lit_magic_string_ex_id_t);
|
||||
|
||||
extern lit_utf8_byte_t *lit_copy_magic_string_to_buffer (lit_magic_string_id_t, lit_utf8_byte_t *, ssize_t);
|
||||
extern lit_utf8_byte_t *lit_copy_magic_string_to_buffer (lit_magic_string_id_t, lit_utf8_byte_t *, lit_utf8_size_t);
|
||||
|
||||
#endif /* LIT_MAGIC_STRINGS_H */
|
||||
|
||||
Reference in New Issue
Block a user