From 2e93de4ad102973961cb24d5b91f0c299763299f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 10 Oct 2024 14:06:43 +0200 Subject: Small warning fixes to gendata --- src/solvers/h48/gendata_h48.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/solvers') diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 3979a39..50ab01c 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h @@ -71,9 +71,15 @@ gendata_h48(gendata_h48_arg_t *arg) cocsepsize = gendata_cocsep(arg->buf, arg->selfsim, arg->crep); - cocsepdata_offset = (char *)arg->buf + INFOSIZE; - arg->cocsepdata = (uint32_t *)cocsepdata_offset; - arg->h48buf = (char *)arg->buf + cocsepsize; + if (arg->buf == NULL) { + cocsepdata_offset = NULL; + arg->cocsepdata = NULL; + arg->h48buf = NULL; + } else { + cocsepdata_offset = (char *)arg->buf + INFOSIZE; + arg->cocsepdata = (uint32_t *)cocsepdata_offset; + arg->h48buf = (char *)arg->buf + cocsepsize; + } arg->base = 99; // TODO: set this somewhere else @@ -683,6 +689,7 @@ gendata_h48_derive(uint8_t h, const void *fulltable, void *buf) /* Initializing values in case of error */ /* TODO cleanup this */ + fulltableinfo.h48h = 11; fulltableinfo.bits = 2; fulltableinfo.base = 8; -- cgit v1.3