Fixed more zchar / string copy errors

Resolves #224
This commit is contained in:
Raphael Coeffic
2021-06-16 18:00:42 +02:00
parent da8e1022a0
commit d10563d08b
4 changed files with 13 additions and 12 deletions
+2 -1
View File
@@ -919,7 +919,8 @@ static int luaGetFlightMode(lua_State * L)
}
lua_pushnumber(L, mode);
char name[sizeof(g_model.flightModeData[0].name)+1];
zchar2str(name, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[0].name));
strncpy(name, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[0].name));
name[sizeof(g_model.flightModeData[0].name)] = '\0';
lua_pushstring(L, name);
return 2;
}