From 00f5c52bfe38bfc49f8c83d8e244e22732008972 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Tue, 31 Dec 2013 10:45:16 +0100
Subject: [PATCH] Added cast to socket() return value to prevent Windows
warning
---
library/net.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/library/net.c b/library/net.c
index 67080a2b7..46902df55 100644
--- a/library/net.c
+++ b/library/net.c
@@ -180,7 +180,8 @@ int net_connect( int *fd, const char *host, int port )
ret = POLARSSL_ERR_NET_UNKNOWN_HOST;
for( cur = addr_list; cur != NULL; cur = cur->ai_next )
{
- *fd = socket( cur->ai_family, cur->ai_socktype, cur->ai_protocol );
+ *fd = (int) socket( cur->ai_family, cur->ai_socktype,
+ cur->ai_protocol );
if( *fd < 0 )
{
ret = POLARSSL_ERR_NET_SOCKET_FAILED;
@@ -267,7 +268,8 @@ int net_bind( int *fd, const char *bind_ip, int port )
ret = POLARSSL_ERR_NET_UNKNOWN_HOST;
for( cur = addr_list; cur != NULL; cur = cur->ai_next )
{
- *fd = socket( cur->ai_family, cur->ai_socktype, cur->ai_protocol );
+ *fd = (int) socket( cur->ai_family, cur->ai_socktype,
+ cur->ai_protocol );
if( *fd < 0 )
{
ret = POLARSSL_ERR_NET_SOCKET_FAILED;