| 1459 | } |
| 1460 | |
| 1461 | static int parse_num(const char *line, unsigned long *p) |
| 1462 | { |
| 1463 | char *ptr; |
| 1464 | |
| 1465 | if (!isdigit(*line)) |
| 1466 | return 0; |
| 1467 | errno = 0; |
| 1468 | *p = strtoul(line, &ptr, 10); |
| 1469 | if (errno) |
| 1470 | return 0; |
| 1471 | return ptr - line; |
| 1472 | } |
| 1473 | |
| 1474 | static int parse_range(const char *line, int len, int offset, const char *expect, |
| 1475 | unsigned long *p1, unsigned long *p2) |