Extend the API documentation for jerry_create_string_* functions (#3234)

- The given string pointer cannot be NULL.
 - Fixed API prototype for jerry_create_string_sz_from_utf8
 - Assert is added for non-NULL pointer in lit_zt_utf8_string_size

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-10-21 13:42:31 +02:00
committed by GitHub
parent 6a2767a09a
commit edf66f4e9b
2 changed files with 17 additions and 13 deletions
+3 -1
View File
@@ -247,13 +247,15 @@ convert_code_point_to_high_surrogate (lit_code_point_t code_point) /**< code poi
* Calculate size of a zero-terminated utf-8 string
*
* NOTE:
* string should not contain zero characters in the middel
* - string cannot be NULL
* - string should not contain zero characters in the middle
*
* @return size of a string
*/
lit_utf8_size_t
lit_zt_utf8_string_size (const lit_utf8_byte_t *utf8_str_p) /**< zero-terminated utf-8 string */
{
JERRY_ASSERT (utf8_str_p != NULL);
return (lit_utf8_size_t) strlen ((const char *) utf8_str_p);
} /* lit_zt_utf8_string_size */