Commit 334e6c69 by Patrick Steinhardt

config: remove last instance of `git__strntol64`

When parsing integers from configuration values, we use `git__strtol64`.
This is fine to do, as we always sanitize values and can thus be sure
that they'll have a terminating `NUL` byte. But as this is the last
call-site of `git__strtol64`, let's just pass in the length explicitly
by calling `strlen` on the value to be able to remove `git__strtol64`
altogether.

(cherry picked from commit 1a2efd10)
parent 5ce26b18
...@@ -1300,7 +1300,7 @@ int git_config_parse_int64(int64_t *out, const char *value) ...@@ -1300,7 +1300,7 @@ int git_config_parse_int64(int64_t *out, const char *value)
const char *num_end; const char *num_end;
int64_t num; int64_t num;
if (!value || git__strtol64(&num, value, &num_end, 0) < 0) if (!value || git__strntol64(&num, value, strlen(value), &num_end, 0) < 0)
goto fail_parse; goto fail_parse;
switch (*num_end) { switch (*num_end) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment