mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-26 07:20:32 +00:00
Str2I64: allow single "+" or "-" prefix before number
This commit is contained in:
parent
cf73aa2029
commit
6104f8b905
1 changed files with 7 additions and 9 deletions
|
@ -13,18 +13,16 @@ I64 Str2I64(U8 *st, I64 radix=10, U8 **_end_ptr=NULL)
|
||||||
}
|
}
|
||||||
while (Bt(char_bmp_white_space, *st))
|
while (Bt(char_bmp_white_space, *st))
|
||||||
st++;
|
st++;
|
||||||
|
if (*st == '+')
|
||||||
|
st++;
|
||||||
|
else if (*st == '-')
|
||||||
|
{
|
||||||
|
neg = TRUE;
|
||||||
|
st++;
|
||||||
|
}
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
switch (*st)
|
switch (*st)
|
||||||
{
|
{
|
||||||
case '-':
|
|
||||||
st++;
|
|
||||||
neg = !neg;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '+':
|
|
||||||
st++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '0':
|
case '0':
|
||||||
st++;
|
st++;
|
||||||
ch = ToUpper(*st);
|
ch = ToUpper(*st);
|
||||||
|
|
Loading…
Reference in a new issue