Skip to content

Commit

Permalink
cppcheck fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
connortechnology committed Jan 10, 2022
1 parent 9f86fd3 commit 78a10b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/zm_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -131,6 +128,8 @@ std::string stringtf(const char* format, ...) {
}

std::unique_ptr<char[]> buf(new char[size]);
va_list args2;
va_copy(args2, args);
vsnprintf(buf.get(), size, format, args2);
va_end(args2);

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 78a10b6

Please sign in to comment.