适配3码互转算法
This commit is contained in:
@@ -137,7 +137,7 @@ static int str_ainttoi(const char *s)
|
||||
}
|
||||
return ret*sig;
|
||||
}
|
||||
static int str_ahextoi(const char *s)
|
||||
int str_ahextoi(const char *s)
|
||||
{
|
||||
int ret=0;
|
||||
while(*s)
|
||||
@@ -164,7 +164,7 @@ static int str_ahextoi(const char *s)
|
||||
}
|
||||
int str_atoi(const char *s)
|
||||
{
|
||||
if(s[0]=='0'&&s[1]=='x'){
|
||||
if(s[0]=='0'&&((s[1]=='x')||(s[1]=='X'))){
|
||||
return str_ahextoi(&s[2]);
|
||||
}else{
|
||||
return str_ainttoi(s);
|
||||
|
Reference in New Issue
Block a user