diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2020-04-05 14:59:54 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-11-27 11:09:19 +0000 |
| commit | 5d6c2f26c0edd72cdb582ec23816f4fb70b57982 (patch) | |
| tree | 97760cb1001b50bb9e745366ccfb9432cfe1c467 /src/diff_print.c | |
| parent | 81609902461217e8ac0781ca6f2a036adc12c278 (diff) | |
| download | libgit2-5d6c2f26c0edd72cdb582ec23816f4fb70b57982.tar.gz | |
diff: use GIT_ASSERT
Diffstat (limited to 'src/diff_print.c')
| -rw-r--r-- | src/diff_print.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/diff_print.c b/src/diff_print.c index 0e93fe893..062e267b0 100644 --- a/src/diff_print.c +++ b/src/diff_print.c @@ -95,7 +95,7 @@ static int diff_print_info_init_frompatch( git_diff_line_cb cb, void *payload) { - assert(patch); + GIT_ASSERT_ARG(patch); memset(pi, 0, sizeof(diff_print_info)); @@ -766,7 +766,9 @@ int git_diff_to_buf(git_buf *out, git_diff *diff, git_diff_format_t format) { int error; - assert(out && diff); + GIT_ASSERT_ARG(out); + GIT_ASSERT_ARG(diff); + if ((error = git_buf_sanitize(out)) < 0) return error; @@ -783,7 +785,8 @@ int git_patch_print( diff_print_info pi; int error; - assert(patch && print_cb); + GIT_ASSERT_ARG(patch); + GIT_ASSERT_ARG(print_cb); if ((error = diff_print_info_init_frompatch(&pi, &temp, patch, GIT_DIFF_FORMAT_PATCH, print_cb, payload)) < 0) @@ -805,7 +808,8 @@ int git_patch_to_buf(git_buf *out, git_patch *patch) { int error; - assert(out && patch); + GIT_ASSERT_ARG(out); + GIT_ASSERT_ARG(patch); if ((error = git_buf_sanitize(out)) < 0) return error; |
