also initialize option value length before calling getsockopt()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-27 00:21:28 +00:00
parent f16ba4bb7e
commit 735ac2bc94

View File

@@ -1680,7 +1680,7 @@ bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen)
{
wxASSERT_MSG( m_impl, _T("Socket not initialised") );
SOCKOPTLEN_T lenreal;
SOCKOPTLEN_T lenreal = *optlen;
if ( getsockopt(m_impl->m_fd, level, optname,
static_cast<char *>(optval), &lenreal) != 0 )
return false;