Fix the number of copied bytes in memmove (#1698)

Fixes #1634

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
Robert Sipka 2017-03-30 10:40:05 +02:00 committed by László Langó
parent 20466a7637
commit 3ff9a7de8a
2 changed files with 3 additions and 1 deletions

View File

@ -398,7 +398,7 @@ ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this
/* Place radix point to the required position. */
if (point < buff_index)
{
memmove (buff + point + 1, buff + point, (size_t) buff_index);
memmove (buff + point + 1, buff + point, (size_t) (buff_index - point));
buff[point] = '.';
buff_index++;
}

View File

@ -90,6 +90,8 @@ assert ((-0x100000000000061).toString(16) === "-100000000000060");
assert((123400).toString(new Number(16)) === "1e208");
assert(65535.9.toString(3) === "10022220020.220022002200220022002210211012200000110221");
var digit_chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',