aboutsummaryrefslogtreecommitdiffhomepage
path: root/unix.c
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2013-08-16 01:18:21 +0300
committerLee Salzman <[email protected]>2013-08-16 01:18:21 +0300
commitc0713c47e664341c16cb46717d6ef031e92ea085 (patch)
tree8aef3b506b52eca7d9dc23d167e9a6f040994e2e /unix.c
parent3595c0b3fb5ebf8a0f10f8d93a94fa12951073eb (diff)
downloadenet-c0713c47e664341c16cb46717d6ef031e92ea085.tar.gz
enet-c0713c47e664341c16cb46717d6ef031e92ea085.zip
more ENET_SOCKOPT_ERROR fixes
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/unix.c b/unix.c
index 19585d3..f04bb6d 100644
--- a/unix.c
+++ b/unix.c
@@ -275,10 +275,12 @@ int
enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
{
int result = -1;
+ socklen_t len;
switch (option)
{
case ENET_SOCKOPT_ERROR:
- result = getsockopt (socket, SOL_SOCKET, SO_ERROR, (char *) value, sizeof (int));
+ len = sizeof (int);
+ result = getsockopt (socket, SOL_SOCKET, SO_ERROR, value, & len);
break;
default: