diff options
Diffstat (limited to 'lib/socket_wrapper')
-rw-r--r-- | lib/socket_wrapper/py_socket_wrapper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/socket_wrapper/py_socket_wrapper.c b/lib/socket_wrapper/py_socket_wrapper.c index 5c8af03124..f5742d3dd1 100644 --- a/lib/socket_wrapper/py_socket_wrapper.c +++ b/lib/socket_wrapper/py_socket_wrapper.c @@ -374,7 +374,7 @@ static PyObject *py_socket_getsockopt(pytalloc_Object *self, PyObject *args) { int level, optname; int *sock; - socklen_t optlen = -1, newlen; + socklen_t optlen = 0, newlen; int optval; bool is_integer = false; char *buffer; @@ -385,7 +385,7 @@ static PyObject *py_socket_getsockopt(pytalloc_Object *self, PyObject *args) return NULL; } - if (optlen < 0) { + if (optlen == 0) { optlen = sizeof(int); is_integer = true; } |