[Fix] Should remove the majority of Valgrind errors.

This commit is contained in:
Allanis 2014-03-10 16:20:56 +00:00
parent e10e6d4bcb
commit cc3955c445
2 changed files with 5 additions and 3 deletions

View File

@ -1025,6 +1025,7 @@ static int ai_face(lua_State* L) {
vect_cset(&tv, VX(p->solid->pos), VY(p->solid->pos));
lv = NULL;
}
else LLUA_INVALID_PARAMETER();
}
else if(lua_isvector(L, 1))
lv = lua_tovector(L, 1);

View File

@ -223,9 +223,10 @@ static void map_update(unsigned int wid) {
}
/* Get planets. */
if(sys->nplanets == 0)
window_modifyText(wid, "txtPlanets", "None");
else {
if(sys->nplanets == 0) {
strncpy(buf, "None", 128);
window_modifyText(wid, "txtPlanets", buf);
} else {
buf[0] = '\0';
if(sys->nplanets > 0)
strcat(buf, sys->planets[0]->name);