From 141110cbd702e0ace0b8ee6c4a6b377144a37618 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Sat, 30 Dec 2023 15:20:33 -0400 Subject: [PATCH] maybe fix uninitialized warnings --- src/r-kernel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/r-kernel.c b/src/r-kernel.c index a91325a..cf5055e 100644 --- a/src/r-kernel.c +++ b/src/r-kernel.c @@ -74,7 +74,13 @@ SEXP geoarrow_c_kernel_push(SEXP kernel_xptr, SEXP args_sexp, SEXP array_out_xpt // All kernels currently have just one argument struct ArrowArray* args[1]; + memset(args, 0, sizeof(args)); + int n_args = Rf_length(args_sexp); + if (n_args != 1) { + Rf_error("Kernels must be passed one argument"); + } + for (int i = 0; i < n_args; i++) { args[i] = (struct ArrowArray*)R_ExternalPtrAddr(VECTOR_ELT(args_sexp, i)); }