Parse numeric argument from command line */
| 161 | |
| 162 | /* Parse numeric argument from command line */ |
| 163 | static unsigned long get_uint(const char *arg, const char *name, |
| 164 | unsigned int limit) |
| 165 | { |
| 166 | unsigned long u; |
| 167 | char *endp; |
| 168 | |
| 169 | u = strtoul(arg, &endp, 0); |
| 170 | if (*arg == '\0' || *endp != '\0') |
| 171 | rte_exit(EXIT_FAILURE, |
| 172 | "Specified %s \"%s\" is not a valid number\n", |
| 173 | name, arg); |
| 174 | if (limit && u > limit) |
| 175 | rte_exit(EXIT_FAILURE, |
| 176 | "Specified %s \"%s\" is too large (greater than %u)\n", |
| 177 | name, arg, limit); |
| 178 | |
| 179 | return u; |
| 180 | } |
| 181 | |
| 182 | /* Set auto stop values */ |
| 183 | static void auto_stop(char *opt) |
no test coverage detected