From 78a10b6095b3759d341a1a336ac2b73a880871b4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 10 Jan 2022 17:35:11 -0500 Subject: [PATCH] cppcheck fixes --- src/zm_utils.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/zm_utils.cpp b/src/zm_utils.cpp index 409429667..bc17e5758 100644 --- a/src/zm_utils.cpp +++ b/src/zm_utils.cpp @@ -120,9 +120,6 @@ std::string Join(const StringVector &values, const std::string &delim) { std::string stringtf(const char* format, ...) { va_list args; va_start(args, format); - va_list args2; - va_copy(args2, args); - int size = vsnprintf(nullptr, 0, format, args) + 1; // Extra space for '\0' va_end(args); @@ -131,6 +128,8 @@ std::string stringtf(const char* format, ...) { } std::unique_ptr buf(new char[size]); + va_list args2; + va_copy(args2, args); vsnprintf(buf.get(), size, format, args2); va_end(args2); @@ -259,6 +258,8 @@ void HwCapsDetect() { unsigned long auxval = 0; elf_aux_info(AT_HWCAP, &auxval, sizeof(auxval)); if (auxval & HWCAP_NEON) { + #else + { #error Unsupported OS. #endif Debug(1,"Detected ARM (AArch32) processor with Neon");