diff options
| author | Thomas Schmucker <ts@its1.de> | 2020-06-18 08:37:21 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2020-06-18 08:37:21 +0200 |
| commit | fbc7b6aa36b2496e65c4f56ba68c50d10f52eb79 (patch) | |
| tree | 7ff377d4882a1940c3bd0ae17a47cf7035cde5c4 /csv-test.c | |
| parent | 076ebd53209016038c1905ae9f95ad2b7fc11fa0 (diff) | |
| download | libcsv-fbc7b6aa36b2496e65c4f56ba68c50d10f52eb79.tar.gz libcsv-fbc7b6aa36b2496e65c4f56ba68c50d10f52eb79.tar.bz2 libcsv-fbc7b6aa36b2496e65c4f56ba68c50d10f52eb79.zip | |
Parameter werden nun überall wo möglich geprüft.
Diffstat (limited to 'csv-test.c')
| -rw-r--r-- | csv-test.c | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -74,6 +74,7 @@ INLINE void | |||
| 74 | csv_string_append(csv_string_t *csv_string, char ch, const csv_options_t * const csv_options) | 74 | csv_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 | |||
| 141 | csv_field_append(csv_field_t *csv_field, int idx, const csv_options_t * const csv_options) | 142 | csv_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 | |||
| 250 | csv_read(csv_t *csv, FILE *in) | 252 | csv_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 | |||
| 395 | csv_write_field(const csv_options_t * const csv_options, const char *field, FILE *out) | 398 | csv_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 | |||
| 419 | csv_write(const csv_options_t * const csv_options, int n, const char *fields[], FILE *out) | 424 | csv_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 | ||
