reader: use GIT_ASSERT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/src/reader.c b/src/reader.c
index 90f700a..9672473 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -61,7 +61,8 @@ int git_reader_for_tree(git_reader **out, git_tree *tree)
{
tree_reader *reader;
- assert(out && tree);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(tree);
reader = git__calloc(1, sizeof(tree_reader));
GIT_ERROR_CHECK_ALLOC(reader);
@@ -158,7 +159,8 @@ int git_reader_for_workdir(
workdir_reader *reader;
int error;
- assert(out && repo);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(repo);
reader = git__calloc(1, sizeof(workdir_reader));
GIT_ERROR_CHECK_ALLOC(reader);
@@ -223,7 +225,8 @@ int git_reader_for_index(
index_reader *reader;
int error;
- assert(out && repo);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(repo);
reader = git__calloc(1, sizeof(index_reader));
GIT_ERROR_CHECK_ALLOC(reader);
@@ -251,7 +254,9 @@ int git_reader_read(
git_reader *reader,
const char *filename)
{
- assert(out && reader && filename);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(reader);
+ GIT_ASSERT_ARG(filename);
return reader->read(out, out_id, out_filemode, reader, filename);
}