MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_uint

Function get_uint

dpdk/app/dumpcap/main.c:163–180  ·  view source on GitHub ↗

Parse numeric argument from command line */

Source from the content-addressed store, hash-verified

161
162/* Parse numeric argument from command line */
163static 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 */
183static void auto_stop(char *opt)

Callers 3

auto_stopFunction · 0.85
find_interfacesFunction · 0.85
parse_optsFunction · 0.85

Calls 2

strtoulFunction · 0.85
rte_exitFunction · 0.85

Tested by

no test coverage detected