mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fixing sign of converted number in ecma_zt_string_to_number.
This commit is contained in:
parent
427dd83d99
commit
e9a632ea4e
@ -187,7 +187,14 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
||||
|
||||
if (begin_p > end_p)
|
||||
{
|
||||
return num;
|
||||
if (sign)
|
||||
{
|
||||
return -num;
|
||||
}
|
||||
else
|
||||
{
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t e = 0;
|
||||
@ -198,7 +205,14 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
||||
|
||||
if (begin_p > end_p)
|
||||
{
|
||||
return num;
|
||||
if (sign)
|
||||
{
|
||||
return -num;
|
||||
}
|
||||
else
|
||||
{
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
while (begin_p <= end_p)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user