Skip to content

Commit e63117a

Browse files
authored
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
1 parent da4d656 commit e63117a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/socketmodule.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ set_herror(int h_error)
658658
PyObject *v;
659659

660660
#ifdef HAVE_HSTRERROR
661-
v = Py_BuildValue("(is)", h_error, (char *)hstrerror(h_error));
661+
v = Py_BuildValue("(is)", h_error, hstrerror(h_error));
662662
#else
663663
v = Py_BuildValue("(is)", h_error, "host not found");
664664
#endif

0 commit comments

Comments
 (0)