diff options
| author | Patrick Steinhardt <ps@pks.im> | 2018-10-25 11:21:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-25 11:21:14 +0200 |
| commit | bea65980c7a42e34edfafbdc40b199ba7b2a564e (patch) | |
| tree | 0d2e8e646b4c8f6ecff728c03a3fc3652eb3238f /src/revparse.c | |
| parent | 1194546138cbbe3d822e4df2a41179a847099e75 (diff) | |
| parent | ea19efc19fa683d632af3e172868bc4350724813 (diff) | |
| download | libgit2-bea65980c7a42e34edfafbdc40b199ba7b2a564e.tar.gz | |
Merge pull request #4851 from pks-t/pks/strtol-removal
strtol removal
Diffstat (limited to 'src/revparse.c')
| -rw-r--r-- | src/revparse.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/revparse.c b/src/revparse.c index bdbf87558..df96f9d86 100644 --- a/src/revparse.c +++ b/src/revparse.c @@ -128,7 +128,8 @@ static int try_parse_numeric(int *n, const char *curly_braces_content) int32_t content; const char *end_ptr; - if (git__strtol32(&content, curly_braces_content, &end_ptr, 10) < 0) + if (git__strntol32(&content, curly_braces_content, strlen(curly_braces_content), + &end_ptr, 10) < 0) return -1; if (*end_ptr != '\0') @@ -578,7 +579,7 @@ static int extract_how_many(int *n, const char *spec, size_t *pos) } while (spec[(*pos)] == kind && kind == '~'); if (git__isdigit(spec[*pos])) { - if (git__strtol32(&parsed, spec + *pos, &end_ptr, 10) < 0) + if (git__strntol32(&parsed, spec + *pos, strlen(spec + *pos), &end_ptr, 10) < 0) return GIT_EINVALIDSPEC; accumulated += (parsed - 1); |
