mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
compatibility bits for converting strings starting with negative sign to unsigned integer
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e8bf4fd137
commit
ed371fbd0f
1 changed files with 3 additions and 1 deletions
|
@ -2470,7 +2470,9 @@ qlonglong QLocalePrivate::bytearrayToLongLong(const char *num, int base, bool *o
|
|||
|
||||
qulonglong QLocalePrivate::bytearrayToUnsLongLong(const char *num, int base, bool *ok)
|
||||
{
|
||||
if (Q_UNLIKELY(*num == '\0')) {
|
||||
// for compatibility strings starting with negative sign shall return 0 and set ok to false,
|
||||
// standard C library implementation handles it like overflow
|
||||
if (Q_UNLIKELY(*num == '\0' || *num == '-')) {
|
||||
if (ok != Q_NULLPTR)
|
||||
*ok = false;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue