Skip to content

Commit

Permalink
Fix coverity #29352
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Feb 23, 2015
1 parent 0ebb403 commit 8beeeba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/scripting/serialize.cpp
Expand Up @@ -99,8 +99,8 @@ void save_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, Writer& writer)
}
case OT_BOOL: {
SQBool val;
sq_getbool(vm, -1, &val);
writer.write(key, val == SQTrue);
if(SQ_SUCCEEDED(sq_getbool(vm, -1, &val)))
writer.write(key, val == SQTrue);
break;
}
case OT_STRING: {
Expand Down
11 changes: 6 additions & 5 deletions src/scripting/squirrel_util.cpp
Expand Up @@ -37,11 +37,12 @@ std::string squirrel2string(HSQUIRRELVM v, SQInteger i)
break;
case OT_BOOL: {
SQBool p;
sq_getbool(v, i, &p);
if (p)
os << "true";
else
os << "false";
if SQ_SUCCEEDED(sq_getbool(v, i, &p)) {
if (p)
os << "true";
else
os << "false";
}
break;
}
case OT_INTEGER: {
Expand Down

0 comments on commit 8beeeba

Please sign in to comment.