diff options
author | Ben Straub <bstraub@github.com> | 2012-06-19 21:11:48 -0700 |
---|---|---|
committer | Ben Straub <bstraub@github.com> | 2012-06-19 21:11:48 -0700 |
commit | eb6bc45f6db0de0a445c09d2c7f5c2eaa3669103 (patch) | |
tree | be8762a64e8368dafa425559107302736fba0a4c /src | |
parent | 1d94a7d0f6c8cb0d1fcf288a1734a7a5abd1b094 (diff) | |
download | libgit2-eb6bc45f6db0de0a445c09d2c7f5c2eaa3669103.tar.gz |
Avoid uninitialized variable error.
Diffstat (limited to 'src')
-rw-r--r-- | src/revparse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/revparse.c b/src/revparse.c index c275b55a..46abb056 100644 --- a/src/revparse.c +++ b/src/revparse.c @@ -506,8 +506,8 @@ static int handle_linear_syntax(git_object **out, git_object *obj, const char *m /* "~" is the same as "~1" */ if (*movement == '\0') { n = 1; - } else { - git__strtol32(&n, movement, NULL, 0); + } else if (git__strtol32(&n, movement, NULL, 0) < 0) { + return GIT_ERROR; } commit1 = (git_commit*)obj; |