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

Function str2int64

freebsd/kern/kern_rctl.c:864–880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862}
863
864static int
865str2int64(const char *str, int64_t *value)
866{
867 char *end;
868
869 if (str == NULL)
870 return (EINVAL);
871
872 *value = strtoul(str, &end, 10);
873 if ((size_t)(end - str) != strlen(str))
874 return (EINVAL);
875
876 if (*value < 0)
877 return (ERANGE);
878
879 return (0);
880}
881
882/*
883 * Connect the rule to the racct, increasing refcount for the rule.

Callers 1

rctl_string_to_ruleFunction · 0.85

Calls 1

strtoulFunction · 0.85

Tested by

no test coverage detected