aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2025-04-10 22:43:55 +0200
committerThomas Schmucker <ts@its1.de>2025-04-10 22:43:55 +0200
commit0140964a5972f10312f3b93c23f4903f510c09e8 (patch)
tree65403318c4071046043872c63ad3b476c5ffddf9
parent41d8eaca5bbe16144cbb0d98c8522c8f6a137c1d (diff)
downloadlibcsv-0140964a5972f10312f3b93c23f4903f510c09e8.tar.gz
libcsv-0140964a5972f10312f3b93c23f4903f510c09e8.tar.bz2
libcsv-0140964a5972f10312f3b93c23f4903f510c09e8.zip
minor changes
-rw-r--r--csv-perf.c2
-rw-r--r--csv-test.c3
-rw-r--r--csv.c2
3 files changed, 3 insertions, 4 deletions
diff --git a/csv-perf.c b/csv-perf.c
index 37616e4..1c0f7a3 100644
--- a/csv-perf.c
+++ b/csv-perf.c
@@ -1,6 +1,4 @@
1#include <assert.h> 1#include <assert.h>
2#include <setjmp.h>
3#include <signal.h>
4#include <stdio.h> 2#include <stdio.h>
5#include <stdlib.h> 3#include <stdlib.h>
6#include <time.h> 4#include <time.h>
diff --git a/csv-test.c b/csv-test.c
index 854df7f..c99c049 100644
--- a/csv-test.c
+++ b/csv-test.c
@@ -16,7 +16,7 @@
16 (void) fclose(f); \ 16 (void) fclose(f); \
17 f = NULL 17 f = NULL
18 18
19#define UNUSED(x) (void) (sizeof((x), 0)) 19#define UNUSED(x) (void) (x)
20 20
21void 21void
22test_empty_object(void) 22test_empty_object(void)
@@ -508,6 +508,7 @@ my_allocate(size_t n, size_t size, void *cb_arg)
508 UNUSED(cb_arg); 508 UNUSED(cb_arg);
509 509
510 void *ptr = calloc(n, size); 510 void *ptr = calloc(n, size);
511
511 return ptr; 512 return ptr;
512} 513}
513 514
diff --git a/csv.c b/csv.c
index 1ef0bde..e9c7464 100644
--- a/csv.c
+++ b/csv.c
@@ -260,7 +260,7 @@ csv_field(const csv_t *const csv, size_t idx)
260 assert(csv != NULL); 260 assert(csv != NULL);
261 assert(idx >= 0 && idx < csv->csv_field.pos); 261 assert(idx >= 0 && idx < csv->csv_field.pos);
262 262
263 if ( idx < 0 || idx >= csv->csv_field.pos ) { 263 if ( idx >= csv->csv_field.pos ) {
264 csv_fatal_error(CSV_ERR_OUT_OF_RANGE, csv->csv_options); 264 csv_fatal_error(CSV_ERR_OUT_OF_RANGE, csv->csv_options);
265 return NULL; 265 return NULL;
266 } 266 }