MCPcopy Create free account
hub / github.com/coreboot/coreboot / atol

Function atol

src/lib/string.c:177–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177long atol(const char *str)
178{
179 long ret = 0;
180 long sign = 1;
181
182 str += strspn(str, " \t\n\r\f\v");
183
184 if (*str == '+') {
185 sign = 1;
186 str++;
187 } else if (*str == '-') {
188 sign = -1;
189 str++;
190 }
191
192 while (isdigit(*str)) {
193 ret *= 10;
194 ret += *str++ - '0';
195 }
196 return ret * sign;
197}

Callers 4

init_frb2_wdtFunction · 0.50
vpd_get_intFunction · 0.50
test_atolFunction · 0.50

Calls 2

strspnFunction · 0.70
isdigitFunction · 0.50

Tested by 1

test_atolFunction · 0.40