xref: /aosp_15_r20/external/coreboot/src/commonlib/bsd/string.c (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 
3 #include <commonlib/bsd/string.h>
4 #include <ctype.h>
5 
skip_atoi(char ** ptr)6 unsigned int skip_atoi(char **ptr)
7 {
8 	unsigned int result = 0;
9 	char *str;
10 
11 	for (str = *ptr; isdigit(str[0]); str++)
12 		result = result * 10 + (str[0] - '0');
13 	*ptr = str;
14 	return result;
15 }
16