diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-03-28 18:59:12 +0200 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-04-02 20:41:48 +0200 |
commit | 73fe6a8e20ffbc18ad667ff519c0fb8adf85fc3e (patch) | |
tree | 4789c5bc53875b6c11e6642bf16aa76862db711b /src/oid.c | |
parent | ae4cae4e08bd3a8a52069f00a688072ef1e85542 (diff) | |
download | libgit2-73fe6a8e20ffbc18ad667ff519c0fb8adf85fc3e.tar.gz |
error-handling: Commit (WIP)
Diffstat (limited to 'src/oid.c')
-rw-r--r-- | src/oid.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |