summaryrefslogtreecommitdiff
path: root/src/oid.c
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-03-28 18:59:12 +0200
committerVicent Martí <tanoku@gmail.com>2012-04-02 20:41:48 +0200
commit73fe6a8e20ffbc18ad667ff519c0fb8adf85fc3e (patch)
tree4789c5bc53875b6c11e6642bf16aa76862db711b /src/oid.c
parentae4cae4e08bd3a8a52069f00a688072ef1e85542 (diff)
downloadlibgit2-73fe6a8e20ffbc18ad667ff519c0fb8adf85fc3e.tar.gz
error-handling: Commit (WIP)
Diffstat (limited to 'src/oid.c')
-rw-r--r--src/oid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/oid.c b/src/oid.c
index 4adccfb89..7f0a520aa 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -125,13 +125,13 @@ int git_oid__parse(
const char *buffer = *buffer_out;
if (buffer + (header_len + sha_len + 1) > buffer_end)
- return oid_error_invalid("input is too short");
+ return -1;
if (memcmp(buffer, header, header_len) != 0)
- return oid_error_invalid("did not match expected header");
+ return -1;
if (buffer[header_len + sha_len] != '\n')
- return oid_error_invalid("not terminated correctly");
+ return -1;
if (git_oid_fromstr(oid, buffer + header_len) < 0)
return -1;