blob: 3286d41b1cfa88a269e27fe5219b312a9bc37b38 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
/* SPDX-License-Identifier: BSD-3-Clause */
#include <commonlib/bsd/string.h>
#include <ctype.h>
unsigned int skip_atoi(char **ptr)
{
unsigned int result = 0;
char *str;
for (str = *ptr; isdigit(str[0]); str++)
result = result * 10 + (str[0] - '0');
*ptr = str;
return result;
}
|