mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-06-13 20:05:38 +00:00
Better placement of memset() to prevent compiler warning under MSVC
This commit is contained in:
parent
695266cb51
commit
308a586477
|
@ -113,8 +113,6 @@ int net_connect( int *fd, const char *host, int port )
|
||||||
struct sockaddr_in server_addr;
|
struct sockaddr_in server_addr;
|
||||||
struct hostent *server_host;
|
struct hostent *server_host;
|
||||||
|
|
||||||
memset( &server_addr, 0, sizeof( server_addr ) );
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN32_WCE)
|
#if defined(_WIN32) || defined(_WIN32_WCE)
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
|
|
||||||
|
@ -129,6 +127,8 @@ int net_connect( int *fd, const char *host, int port )
|
||||||
signal( SIGPIPE, SIG_IGN );
|
signal( SIGPIPE, SIG_IGN );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
memset( &server_addr, 0, sizeof( server_addr ) );
|
||||||
|
|
||||||
if( ( server_host = gethostbyname( host ) ) == NULL )
|
if( ( server_host = gethostbyname( host ) ) == NULL )
|
||||||
return( POLARSSL_ERR_NET_UNKNOWN_HOST );
|
return( POLARSSL_ERR_NET_UNKNOWN_HOST );
|
||||||
|
|
||||||
|
@ -160,8 +160,6 @@ int net_bind( int *fd, const char *bind_ip, int port )
|
||||||
int n, c[4];
|
int n, c[4];
|
||||||
struct sockaddr_in server_addr;
|
struct sockaddr_in server_addr;
|
||||||
|
|
||||||
memset( &server_addr, 0, sizeof( server_addr ) );
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN32_WCE)
|
#if defined(_WIN32) || defined(_WIN32_WCE)
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
|
|
||||||
|
@ -176,6 +174,8 @@ int net_bind( int *fd, const char *bind_ip, int port )
|
||||||
signal( SIGPIPE, SIG_IGN );
|
signal( SIGPIPE, SIG_IGN );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
memset( &server_addr, 0, sizeof( server_addr ) );
|
||||||
|
|
||||||
if( ( *fd = (int) socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 )
|
if( ( *fd = (int) socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 )
|
||||||
return( POLARSSL_ERR_NET_SOCKET_FAILED );
|
return( POLARSSL_ERR_NET_SOCKET_FAILED );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue