| 862 | } |
| 863 | |
| 864 | static int |
| 865 | str2int64(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. |
no test coverage detected