Fix issues revealed by cppcheck 1.83 (#2355)

A more recent cppcheck has revealed some extra issues not detected
by the old one running on CI.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2018-05-24 08:48:34 +02:00
committed by yichoi
parent 9eb9fbf5f1
commit 06910b456e
3 changed files with 7 additions and 9 deletions
+4 -6
View File
@@ -1488,15 +1488,13 @@ jerry_append_ecma_string_to_buffer (uint8_t *buffer_p, /**< buffer */
uint8_t *buffer_end_p, /**< the end of the buffer */
ecma_string_t *string_p) /**< ecma-string */
{
uint8_t *new_buffer_p = NULL;
ECMA_STRING_TO_UTF8_STRING (string_p, str_buffer_p, str_buffer_size);
/* Append the string to the buffer. */
new_buffer_p = jerry_append_chars_to_buffer (buffer_p,
buffer_end_p,
(const char *) str_buffer_p,
str_buffer_size);
uint8_t *new_buffer_p = jerry_append_chars_to_buffer (buffer_p,
buffer_end_p,
(const char *) str_buffer_p,
str_buffer_size);
ECMA_FINALIZE_UTF8_STRING (str_buffer_p, str_buffer_size);