1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix cppcheck warnings

This commit is contained in:
Steffen Vogel 2021-02-22 23:30:19 +01:00
parent 0c8d013f06
commit 5c666fbc15

View file

@ -27,6 +27,7 @@
#include <vector>
#include <map>
#include <cstdio>
extern "C" {
#include "lua.h"
@ -61,7 +62,6 @@ public:
virtual const char * what() const noexcept
{
const char *msg;
switch (err) {
case LUA_ERRSYNTAX:
msg = "Syntax error";
@ -88,13 +88,11 @@ public:
break;
}
/* Append Lua error message */
std::string emsg = "Lua: ";
emsg += msg;
emsg += ": ";
emsg += lua_tostring(L, -1);
char *buf;
return emsg.c_str();
asprintf(&buf, "Lua: %s: %s", msg, lua_tostring(L, -1));
return buf;
}
};