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