Fix for issue #1974
The buffer size was previously badly computed since scale == 0 case was not checked, therefore the buffer size was smaller than intended. This patch fixes this issue. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -290,10 +290,10 @@ ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this
|
||||
}
|
||||
|
||||
int buff_size = 1;
|
||||
if (is_scale_negative)
|
||||
if (is_scale_negative || scale == 0)
|
||||
{
|
||||
double counter = this_arg_number;
|
||||
while (counter > radix)
|
||||
while (counter >= radix)
|
||||
{
|
||||
counter /= radix;
|
||||
buff_size++;
|
||||
|
||||
Reference in New Issue
Block a user