1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-22 23:58:48 -05:00

Fix memleak pointed by issue #2439.

Also change bzero to memset. bzero doesn't work on windows
This commit is contained in:
Loic Blot 2015-03-08 18:13:27 +01:00
parent 57d86cf574
commit 3ae16f1c17

View File

@ -401,8 +401,8 @@ void Client::step(float dtime)
char pName[PLAYERNAME_SIZE];
char pPassword[PASSWORD_SIZE];
bzero(pName, PLAYERNAME_SIZE);
bzero(pPassword, PLAYERNAME_SIZE);
memset(pName, 0, PLAYERNAME_SIZE * sizeof(char));
memset(pPassword, 0, PASSWORD_SIZE * sizeof(char));
snprintf(pName, PLAYERNAME_SIZE, "%s", myplayer->getName());
snprintf(pPassword, PASSWORD_SIZE, "%s", m_password.c_str());