summaryrefslogtreecommitdiff
path: root/csv-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'csv-test.c')
-rw-r--r--csv-test.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/csv-test.c b/csv-test.c
index 6c32a04..0d9d6e1 100644
--- a/csv-test.c
+++ b/csv-test.c
@@ -74,6 +74,7 @@ INLINE void
74csv_string_append(csv_string_t *csv_string, char ch, const csv_options_t * const csv_options) 74csv_string_append(csv_string_t *csv_string, char ch, const csv_options_t * const csv_options)
75{ 75{
76 assert(csv_string != NULL); 76 assert(csv_string != NULL);
77 assert(csv_options != NULL);
77 78
78 static const int INITIAL_CAP = 16; 79 static const int INITIAL_CAP = 16;
79 80
@@ -141,6 +142,7 @@ INLINE void
141csv_field_append(csv_field_t *csv_field, int idx, const csv_options_t * const csv_options) 142csv_field_append(csv_field_t *csv_field, int idx, const csv_options_t * const csv_options)
142{ 143{
143 assert(csv_field != NULL); 144 assert(csv_field != NULL);
145 assert(csv_options != NULL);
144 146
145 static const size_t INITIAL_CAP = 16; 147 static const size_t INITIAL_CAP = 16;
146 148
@@ -250,6 +252,7 @@ int
250csv_read(csv_t *csv, FILE *in) 252csv_read(csv_t *csv, FILE *in)
251{ 253{
252 assert(csv != NULL); 254 assert(csv != NULL);
255 assert(in != NULL);
253 256
254 enum { 257 enum {
255 STATE_START_FIELD, 258 STATE_START_FIELD,
@@ -395,6 +398,8 @@ static void
395csv_write_field(const csv_options_t * const csv_options, const char *field, FILE *out) 398csv_write_field(const csv_options_t * const csv_options, const char *field, FILE *out)
396{ 399{
397 assert(csv_options != NULL); 400 assert(csv_options != NULL);
401 assert(field != NULL);
402 assert(out != NULL);
398 403
399 const char QUOTE = csv_options->quote_symbol; 404 const char QUOTE = csv_options->quote_symbol;
400 405
@@ -419,6 +424,8 @@ void
419csv_write(const csv_options_t * const csv_options, int n, const char *fields[], FILE *out) 424csv_write(const csv_options_t * const csv_options, int n, const char *fields[], FILE *out)
420{ 425{
421 assert(csv_options != NULL); 426 assert(csv_options != NULL);
427 assert(fields != NULL);
428 assert(out != NULL);
422 429
423 const char SEP = csv_options->quote_symbol; 430 const char SEP = csv_options->quote_symbol;
424 431