diff options
author | Patrick Steinhardt <ps@pks.im> | 2018-10-18 11:35:08 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-10-26 14:20:35 +0200 |
commit | 334e6c6993ac45cb36b986f483671cd15d578642 (patch) | |
tree | 878717c6e6df8966b306c339e0de10946cde0eba | |
parent | 5ce26b187b52f60d4ac4862bea2a4d8a7b0da0a6 (diff) | |
download | libgit2-334e6c6993ac45cb36b986f483671cd15d578642.tar.gz |
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 1a2efd10bde66f798375e2f47ba57ef00ad5c193)
-rw-r--r-- | src/config.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 1bc11b99f..5d95c2458 100644 --- a/src/config.c +++ b/src/config.c @@ -1300,7 +1300,7 @@ int git_config_parse_int64(int64_t *out, const char *value) const char *num_end; 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; switch (*num_end) { |