diff options
Diffstat (limited to 'src/delta-apply.c')
-rw-r--r-- | src/delta-apply.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/delta-apply.c b/src/delta-apply.c index 815ca8f16..a39c7af5c 100644 --- a/src/delta-apply.c +++ b/src/delta-apply.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2012 the libgit2 contributors + * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. @@ -36,6 +36,19 @@ static int hdr_sz( return 0; } +int git__delta_read_header( + const unsigned char *delta, + size_t delta_len, + size_t *base_sz, + size_t *res_sz) +{ + const unsigned char *delta_end = delta + delta_len; + if ((hdr_sz(base_sz, &delta, delta_end) < 0) || + (hdr_sz(res_sz, &delta, delta_end) < 0)) + return -1; + return 0; +} + int git__delta_apply( git_rawobj *out, const unsigned char *base, |