aboutsummaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-08 18:13:27 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-08 18:13:27 +0100
commit3ae16f1c17c2b23c143b5a4ee6191f37d5371633 (patch)
tree3cf9e770b0989f4cda77722acf5e875cd7a7fc79 /src/client.cpp
parent57d86cf57411225433c651cf50fe9e130cf407e3 (diff)
downloadhax-minetest-server-3ae16f1c17c2b23c143b5a4ee6191f37d5371633.tar.gz
hax-minetest-server-3ae16f1c17c2b23c143b5a4ee6191f37d5371633.zip
Fix memleak pointed by issue #2439.
Also change bzero to memset. bzero doesn't work on windows
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp
index ba6835f51..e36c04edc 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -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());