MCPcopy Create free account
hub / github.com/coreutils/coreutils / xstr2nonneg

Function xstr2nonneg

src/od.c:1449–1455  ·  view source on GitHub ↗

Act like xstrtoimax (NPTR, NULL, BASE, VAL, VALID_SUFFIXES), except reject negative values, and *VAL may be set if LONGINT_INVALID is returned. */

Source from the content-addressed store, hash-verified

1447 except reject negative values, and *VAL may be set if
1448 LONGINT_INVALID is returned. */
1449static strtol_error
1450xstr2nonneg (char const *restrict nptr, int base, intmax_t *val,
1451 char const *restrict valid_suffixes)
1452{
1453 strtol_error s_err = xstrtoimax (nptr, NULL, base, val, valid_suffixes);
1454 return s_err != LONGINT_INVALID && *val < 0 ? LONGINT_INVALID : s_err;
1455}
1456
1457/* If STR is a valid traditional offset specification with an optional
1458 leading '+', and can be represented in intmax_t, return true and

Callers 2

parse_old_offsetFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected