parse integer return true if string represents an integer
| 105 | // parse integer |
| 106 | // return true if string represents an integer |
| 107 | static inline bool _Config_ParseInteger |
| 108 | ( |
| 109 | const char *integer_str, |
| 110 | long long *value |
| 111 | ) { |
| 112 | char *endptr; |
| 113 | errno = 0; // To distinguish success/failure after call |
| 114 | *value = strtoll(integer_str, &endptr, 10); |
| 115 | |
| 116 | // Return an error code if integer parsing fails. |
| 117 | return (errno == 0 && endptr != integer_str && *endptr == '\0'); |
| 118 | } |
| 119 | |
| 120 | // parse positive integer |
| 121 | // return true if string represents a positive integer > 0 |
no outgoing calls
no test coverage detected