summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-03-06 04:43:36 (GMT)
committerGitHub <noreply@github.com>2020-03-06 04:43:36 (GMT)
commite63117a84ef11083be86db7afb2ac2789491ca09 (patch)
tree977ce423744f8be0015a7a7e2ab7ca9ecd27f872 /Modules/socketmodule.c
parentda4d656e951b00580d135ae6345656ecedf9d8d4 (diff)
downloadcpython-e63117a84ef11083be86db7afb2ac2789491ca09.zip
cpython-e63117a84ef11083be86db7afb2ac2789491ca09.tar.gz
cpython-e63117a84ef11083be86db7afb2ac2789491ca09.tar.bz2
closes bpo-39859: Do not downcast result of hstrerror (GH-18790)
set_herror builds a string by calling hstrerror but downcasts its return value to char *. It should be const char *. Automerge-Triggered-By: @benjaminp
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 37b3123..2818ac7 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -658,7 +658,7 @@ set_herror(int h_error)
PyObject *v;
#ifdef HAVE_HSTRERROR
- v = Py_BuildValue("(is)", h_error, (char *)hstrerror(h_error));
+ v = Py_BuildValue("(is)", h_error, hstrerror(h_error));
#else
v = Py_BuildValue("(is)", h_error, "host not found");
#endif