Ran format.py after writing unit tests for and fixing bugs in it (#239)

This commit is contained in:
Tyler Veness
2016-09-21 23:48:54 -07:00
committed by Peter Johnson
parent ac9b6f7b18
commit 659dbef751
20 changed files with 96 additions and 75 deletions

View File

@@ -10,6 +10,8 @@
#include <cxxabi.h>
#include <execinfo.h>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include "HAL/HAL.h"
@@ -182,7 +184,7 @@ static std::string demangle(char const* mangledSymbol) {
size_t length;
int32_t status;
if (sscanf(mangledSymbol, "%*[^(]%*[(]%255[^)+]", buffer)) {
if (std::sscanf(mangledSymbol, "%*[^(]%*[(]%255[^)+]", buffer)) {
char* symbol = abi::__cxa_demangle(buffer, nullptr, &length, &status);
if (status == 0) {
return symbol;
@@ -214,7 +216,7 @@ std::string GetStackTrace(int offset) {
}
}
free(mangledSymbols);
std::free(mangledSymbols);
return trace.str();
}