mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
vbox: Replace atoi with virStrToLong_i
Parsing is stricter now and doesn't accept trailing characters after the actual value or non-number strings anymore. atoi just returns 0 in case it cannot parse a number from the given string. Now an error is reported for such a string.
This commit is contained in:
parent
73b45bfbff
commit
2f047d4816
@ -598,7 +598,9 @@ static int PRUnicharToInt(PRUnichar *strUtf16) {
|
||||
if (!strUtf8)
|
||||
return -1;
|
||||
|
||||
ret = atoi(strUtf8);
|
||||
if (virStrToLong_i(strUtf8, NULL, 10, &ret) < 0)
|
||||
ret = -1;
|
||||
|
||||
g_pVBoxGlobalData->pFuncs->pfnUtf8Free(strUtf8);
|
||||
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user