* strtoint --- just like strtol, but returns int not long */
| 47 | * strtoint --- just like strtol, but returns int not long |
| 48 | */ |
| 49 | int |
| 50 | strtoint(const char *pg_restrict str, char **pg_restrict endptr, int base) |
| 51 | { |
| 52 | long val; |
| 53 | |
| 54 | val = strtol(str, endptr, base); |
| 55 | if (val != (int) val) |
| 56 | errno = ERANGE; |
| 57 | return (int) val; |
| 58 | } |
| 59 | |
| 60 | |
| 61 | /* |
no outgoing calls
no test coverage detected