summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-06-02 00:01:11 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-06-02 00:01:11 +0300
commit51cf464f7450ee31e3a986b521f90cc6195bb2fb (patch)
tree8ba28ebba364d3505c946e987c2169912cc153c4 /src/client.cpp
parentbbead93c1a00a1c31956e12c94717f179ac5b84b (diff)
downloadminetest-51cf464f7450ee31e3a986b521f90cc6195bb2fb.tar.gz
minetest-51cf464f7450ee31e3a986b521f90cc6195bb2fb.tar.bz2
minetest-51cf464f7450ee31e3a986b521f90cc6195bb2fb.zip
Fixed the password crash on Windows
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 79bbd8021..e494056f2 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -306,8 +306,14 @@ void Client::step(float dtime)
SharedBuffer<u8> data(2+1+PLAYERNAME_SIZE+PASSWORD_SIZE);
writeU16(&data[0], TOSERVER_INIT);
writeU8(&data[2], SER_FMT_VER_HIGHEST);
+
memset((char*)&data[3], 0, PLAYERNAME_SIZE);
snprintf((char*)&data[3], PLAYERNAME_SIZE, "%s", myplayer->getName());
+
+ /*dstream<<"Client: password hash is \""<<m_password<<"\""
+ <<std::endl;*/
+
+ memset((char*)&data[23], 0, PASSWORD_SIZE);
snprintf((char*)&data[23], PASSWORD_SIZE, "%s", m_password.c_str());
// Send as unreliable