| 1402 | static int digit (int c) { return '0' <= c && c <= '9'; } |
| 1403 | |
| 1404 | static int getnum (const char **fmt, int df) { |
| 1405 | if (!digit(**fmt)) /* no number? */ |
| 1406 | return df; /* return default value */ |
| 1407 | else { |
| 1408 | int a = 0; |
| 1409 | do { |
| 1410 | a = a*10 + (*((*fmt)++) - '0'); |
| 1411 | } while (digit(**fmt) && a <= ((int)MAXSIZE - 9)/10); |
| 1412 | return a; |
| 1413 | } |
| 1414 | } |
| 1415 | |
| 1416 | |
| 1417 | /* |
no test coverage detected