mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix memleak pointed by issue #2439.
Also change bzero to memset. bzero doesn't work on windows
This commit is contained in:
parent
57d86cf574
commit
3ae16f1c17
1 changed files with 2 additions and 2 deletions
|
@ -401,8 +401,8 @@ void Client::step(float dtime)
|
||||||
|
|
||||||
char pName[PLAYERNAME_SIZE];
|
char pName[PLAYERNAME_SIZE];
|
||||||
char pPassword[PASSWORD_SIZE];
|
char pPassword[PASSWORD_SIZE];
|
||||||
bzero(pName, PLAYERNAME_SIZE);
|
memset(pName, 0, PLAYERNAME_SIZE * sizeof(char));
|
||||||
bzero(pPassword, PLAYERNAME_SIZE);
|
memset(pPassword, 0, PASSWORD_SIZE * sizeof(char));
|
||||||
|
|
||||||
snprintf(pName, PLAYERNAME_SIZE, "%s", myplayer->getName());
|
snprintf(pName, PLAYERNAME_SIZE, "%s", myplayer->getName());
|
||||||
snprintf(pPassword, PASSWORD_SIZE, "%s", m_password.c_str());
|
snprintf(pPassword, PASSWORD_SIZE, "%s", m_password.c_str());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue