MCPcopy Create free account
hub / github.com/antirez/ds4 / parse_int_arg

Function parse_int_arg

ds4_eval.c:1433–1441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1431#endif
1432 return (double)ts.tv_sec + (double)ts.tv_nsec / 1000000000.0;
1433}
1434
1435static int parse_int_arg(const char *s, const char *opt) {
1436 char *end = NULL;
1437 long v = strtol(s, &end, 10);
1438 if (s[0] == '\0' || *end != '\0' || v <= 0 || v > INT_MAX) {
1439 fprintf(stderr, "ds4-eval: invalid value for %s: %s\n", opt, s);
1440 exit(2);
1441 }
1442 return (int)v;
1443}
1444

Callers 1

parse_optionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected