Skip to content

Commit

Permalink
Address style suggestion.
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Dec 1, 2023
1 parent 94ea23c commit 5addb69
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7071,10 +7071,7 @@ _socket_socket_if_nametoindex_impl(PySocketSockObject *self, PyObject *oname)
static PyObject *
socket_if_indextoname(PyObject *self, PyObject *arg)
{
unsigned long index_long;
char name[IF_NAMESIZE + 1];

index_long = PyLong_AsUnsignedLong(arg);
unsigned long index_long = PyLong_AsUnsignedLong(arg);
if (index_long == (unsigned long) -1 && PyErr_Occurred()) {
return NULL;
}
Expand All @@ -7090,6 +7087,7 @@ socket_if_indextoname(PyObject *self, PyObject *arg)
return NULL;
}

char name[IF_NAMESIZE + 1];
if (if_indextoname(index, name) == NULL) {
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
Expand Down

0 comments on commit 5addb69

Please sign in to comment.