diff options
author | Inada Naoki <songofacandy@gmail.com> | 2020-06-14 17:49:57 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-14 17:49:57 +0900 |
commit | 25fd070c3864b0271aa6af31236d94c80e79b2eb (patch) | |
tree | 521f54917d60f115fff491dafc9f1ca5bcdabe93 | |
parent | d708e4c08e6603614001d9ac807e7bae693bb69c (diff) | |
download | netifaces-git-25fd070c3864b0271aa6af31236d94c80e79b2eb.tar.gz |
Fix py2
-rw-r--r-- | netifaces.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/netifaces.c b/netifaces.c index 49c7bc3..bf18c80 100644 --- a/netifaces.c +++ b/netifaces.c @@ -1567,7 +1567,7 @@ gateways (PyObject *self) break; } - ifname = PyUnicode_FromWideChar (pwcsName, -1); + ifname = PyUnicode_FromWideChar (pwcsName, wcslen (pwcsName)); isdefault = bBest ? Py_True : Py_False; tuple = PyTuple_Pack (3, gateway, ifname, isdefault); @@ -1674,7 +1674,7 @@ gateways (PyObject *self) if (bBest) dwBestMetric = table->table[n].dwForwardMetric1; - ifname = PyUnicode_FromWideChar (pwcsName, -1); + ifname = PyUnicode_FromWideChar (pwcsName, wcslen (pwcsName)); gateway = PyUnicode_FromString (gwbuf); isdefault = bBest ? Py_True : Py_False; |