Modify the usage of ecma_string_to_utf8_string()

Parts:
 * Rename ecma_string_to_utf8_string() to ecma_string_copy_to_utf8_buffer.

 * Introduce ecma_string_to_utf8_bytes(), which wraps the usual 'function call-assertion' pair,
   and check strict equality of size of the string and the buffer.

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
Zsolt Borbély
2016-06-01 14:46:05 +02:00
parent eac736ffa4
commit c557a0a047
6 changed files with 48 additions and 52 deletions
+1 -1
View File
@@ -540,7 +540,7 @@ jerry_string_to_char_buffer (const jerry_string_t *string_p, /**< string descrip
{
jerry_assert_api_available ();
return ecma_string_to_utf8_string (string_p, (lit_utf8_byte_t *) buffer_p, buffer_size);
return ecma_string_copy_to_utf8_buffer (string_p, (lit_utf8_byte_t *) buffer_p, buffer_size);
} /* jerry_string_to_char_buffer */
/**