diff --git a/src/prover.cpp b/src/prover.cpp index 5da4f41..c3b470c 100644 --- a/src/prover.cpp +++ b/src/prover.cpp @@ -249,7 +249,9 @@ groth16_test_env(char *buffer, unsigned long buffer_maxsize) return PROVER_ERROR_SHORT_BUFFER; } - strncpy(buffer, stream.str().c_str(), buffer_maxsize); + const std::string str = stream.str(); + + strncpy(buffer, str.c_str(), buffer_maxsize); return PROVER_OK; } diff --git a/src/test_prover.cpp b/src/test_prover.cpp index 2f7c519..4d66b4b 100644 --- a/src/test_prover.cpp +++ b/src/test_prover.cpp @@ -6,6 +6,7 @@ #include #include "fr.hpp" #include "fq.hpp" +#include "prover.h" #ifdef USE_OPENMP #include @@ -10934,21 +10935,10 @@ void print_results() void test_env() { -#ifdef USE_ASM -#if defined(ARCH_X86_64) - std::cout << "ASM: x86_64" << std::endl; -#elif defined(ARCH_ARM64) - std::cout << "ASM: arm64" << std::endl; -#endif -#else - std::cout << "ASM is disabled" << std::endl; -#endif + char buffer[4096]; + groth16_test_env(buffer, 4096); -#ifdef USE_OPENMP - std::cout << "OpenMP max threads: " << omp_get_max_threads() << std::endl; -#else - std::cout << "OpenMP is disabled" << std::endl; -#endif + std::cout << buffer << std::endl; } int main()