From 0140964a5972f10312f3b93c23f4903f510c09e8 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 10 Apr 2025 22:43:55 +0200 Subject: minor changes --- csv-perf.c | 2 -- csv-test.c | 3 ++- csv.c | 2 +- 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 @@ #include -#include -#include #include #include #include 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 @@ (void) fclose(f); \ f = NULL -#define UNUSED(x) (void) (sizeof((x), 0)) +#define UNUSED(x) (void) (x) void test_empty_object(void) @@ -508,6 +508,7 @@ my_allocate(size_t n, size_t size, void *cb_arg) UNUSED(cb_arg); void *ptr = calloc(n, size); + return ptr; } 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) assert(csv != NULL); assert(idx >= 0 && idx < csv->csv_field.pos); - if ( idx < 0 || idx >= csv->csv_field.pos ) { + if ( idx >= csv->csv_field.pos ) { csv_fatal_error(CSV_ERR_OUT_OF_RANGE, csv->csv_options); return NULL; } -- cgit v1.3