mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10: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))
|
||||
st++;
|
||||
if (*st == '+')
|
||||
st++;
|
||||
else if (*st == '-')
|
||||
{
|
||||
neg = TRUE;
|
||||
st++;
|
||||
}
|
||||
while (TRUE)
|
||||
switch (*st)
|
||||
{
|
||||
case '-':
|
||||
st++;
|
||||
neg = !neg;
|
||||
break;
|
||||
|
||||
case '+':
|
||||
st++;
|
||||
break;
|
||||
|
||||
case '0':
|
||||
st++;
|
||||
ch = ToUpper(*st);
|
||||
|
|
Loading…
Reference in a new issue