| 3 | #include "parse.h" |
| 4 | |
| 5 | static uintmax_t get_unit_factor(const char *end) |
| 6 | { |
| 7 | if (!*end) |
| 8 | return 1; |
| 9 | else if (!strcasecmp(end, "k")) |
| 10 | return 1024; |
| 11 | else if (!strcasecmp(end, "m")) |
| 12 | return 1024 * 1024; |
| 13 | else if (!strcasecmp(end, "g")) |
| 14 | return 1024 * 1024 * 1024; |
| 15 | return 0; |
| 16 | } |
| 17 | |
| 18 | int git_parse_signed(const char *value, intmax_t *ret, intmax_t max) |
| 19 | { |
no outgoing calls
no test coverage detected