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:
parent
0c8d013f06
commit
5c666fbc15
1 changed files with 5 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue