Skip to content
Snippets Groups Projects
Commit f7b47df1 authored by Frederich Munch's avatar Frederich Munch Committed by Axel Naumann
Browse files

Fix assertion test for null terminated string.

parent 147cc061
No related merge requests found
...@@ -209,7 +209,7 @@ std::string Demangle(const std::string& Symbol) { ...@@ -209,7 +209,7 @@ std::string Demangle(const std::string& Symbol) {
int status = 0; int status = 0;
size_t len; size_t len;
AutoFree af(abi::__cxa_demangle(Symbol.c_str(), 0, &len, &status)); AutoFree af(abi::__cxa_demangle(Symbol.c_str(), 0, &len, &status));
assert(((len && af.Str[len-1]==0) || status != 0) && "Not null terminated"); assert((status != 0 || (len && af.Str[len-1]==0)) && "Not null terminated");
return status == 0 ? std::string(af.Str, len-1) : std::string(); return status == 0 ? std::string(af.Str, len-1) : std::string();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment