summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-10-18 11:35:08 +0200
committerPatrick Steinhardt <ps@pks.im>2018-10-18 11:42:10 +0200
commit1a2efd10bde66f798375e2f47ba57ef00ad5c193 (patch)
tree1d14423d83d07031705b5822a380f4484c250ec1
parent3db9aa6f79711103a331a2bbbd044a3c37d4f136 (diff)
downloadlibgit2-1a2efd10bde66f798375e2f47ba57ef00ad5c193.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.
-rw-r--r--src/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 8d2e12f98..0837500f5 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) {