mirror of
https://github.com/minetest/minetest.git
synced 2024-11-24 00:23:46 +01:00
Fix errors/warnings reported by valgrind
This commit is contained in:
parent
6bd15247f9
commit
eadde1e741
@ -561,6 +561,7 @@ Channel::Channel() :
|
||||
next_outgoing_split_seqnum(SEQNUM_INITIAL),
|
||||
current_packet_loss(0),
|
||||
current_packet_too_late(0),
|
||||
current_packet_successfull(0),
|
||||
packet_loss_counter(0),
|
||||
current_bytes_transfered(0),
|
||||
current_bytes_received(0),
|
||||
@ -3114,4 +3115,3 @@ std::list<u16> Connection::getPeerIDs()
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -68,12 +68,12 @@ inline wchar_t* chartowchar_t(const char *str)
|
||||
MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) str, -1, (WCHAR *) nstr, nResult );
|
||||
}
|
||||
#else
|
||||
size_t l = strlen(str)+1;
|
||||
nstr = new wchar_t[l];
|
||||
size_t l = strlen(str);
|
||||
nstr = new wchar_t[l+1];
|
||||
|
||||
std::wstring intermediate = narrow_to_wide(str);
|
||||
memset(nstr,0,l);
|
||||
memcpy(nstr,intermediate.c_str(),l*sizeof(wchar_t));
|
||||
memset(nstr, 0, (l+1)*sizeof(wchar_t));
|
||||
memcpy(nstr, intermediate.c_str(), l*sizeof(wchar_t));
|
||||
#endif
|
||||
|
||||
return nstr;
|
||||
|
@ -81,6 +81,7 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
|
||||
m_selected_amount(0),
|
||||
m_selected_dragging(false),
|
||||
m_tooltip_element(NULL),
|
||||
m_old_tooltip_id(-1),
|
||||
m_allowclose(true),
|
||||
m_lock(false),
|
||||
m_form_src(fsrc),
|
||||
|
@ -1018,4 +1018,3 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
|
||||
throw SerializationError("unsupported ContentFeatures version");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user