diff options
Diffstat (limited to 'src/apply.c')
-rw-r--r-- | src/apply.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/apply.c b/src/apply.c index 55b1a397f..1ee9291d3 100644 --- a/src/apply.c +++ b/src/apply.c @@ -24,9 +24,6 @@ #include "reader.h" #include "index.h" -#define apply_err(...) \ - ( git_error_set(GIT_ERROR_PATCH, __VA_ARGS__), GIT_EAPPLYFAIL ) - typedef struct { /* The lines that we allocate ourself are allocated out of the pool. * (Lines may have been allocated out of the diff.) @@ -35,6 +32,18 @@ typedef struct { git_vector lines; } patch_image; +static int apply_err(const char *fmt, ...) GIT_FORMAT_PRINTF(1, 2); +static int apply_err(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + git_error_vset(GIT_ERROR_PATCH, fmt, ap); + va_end(ap); + + return GIT_EAPPLYFAIL; +} + static void patch_line_init( git_diff_line *out, const char *in, |