/* From: http://fossies.org/dox/musl-1.0.5/atoi_8c_source.html */
//drivers/wifi/host/platform/actions_ats3503/porting.h
#define isdigit(c) in_range(c, '0', '9')
#define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
//source/stdlib/atoi.c
int atoi(const char *s)
{
int n = 0;
int neg = 0;
while (isspace(*s)) {
s++;
}
switch (*s) {
case '-':
neg = 1;
s++;
break; /* artifact to quiet coverity warning */
case '+':
s++;
}
/* Compute n as a negative number to avoid overflow on INT_MIN */
while (isdigit(*s)) {
n = 10*n - (*s++ - '0');
}
return neg ? n : -n;
}