From c4f64cf2556c0f8597e1fbc19d7c664b8da94612 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 11 Oct 2024 19:24:15 +0200 Subject: Added buffer sizes in API args --- tools/tool.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tools/tool.h') diff --git a/tools/tool.h b/tools/tool.h index 02ff0f2..2fc0224 100644 --- a/tools/tool.h +++ b/tools/tool.h @@ -96,7 +96,7 @@ generatetable(const char *solver, char **buf) } *buf = malloc(size); - gensize = nissy_gendata(solver, *buf); + gensize = nissy_gendata(solver, size, *buf); if (gensize != size) { printf("Error generating table"); @@ -212,7 +212,7 @@ gendata_run( case -2: goto gendata_run_finish; default: - nissy_datainfo(buf, write_stdout); + nissy_datainfo(size, buf, write_stdout); printf("\n"); printf("Succesfully generated %" PRId64 " bytes. " "See above for details on the tables.\n", size); @@ -237,6 +237,7 @@ derivedata_run( int64_t size; char *buf; + buf = NULL; size = derivetable(solver_large, solver_small, filename_large, &buf); switch (size) { case -1: @@ -244,7 +245,7 @@ derivedata_run( case -2: goto derivedata_run_finish; default: - nissy_datainfo(buf, write_stdout); + nissy_datainfo(size, buf, write_stdout); printf("\n"); printf("Succesfully generated %" PRId64 " bytes. " "See above for details on the tables.\n", size); -- cgit v1.3