41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
$OpenBSD: patch-Modules_socketmodule_c,v 1.3 2006/11/01 20:02:06 alek Exp $
|
|
--- Modules/socketmodule.c.orig Thu Dec 30 14:52:17 2004
|
|
+++ Modules/socketmodule.c Sat Oct 21 13:56:35 2006
|
|
@@ -63,9 +63,6 @@ Local naming conventions:
|
|
|
|
#include "Python.h"
|
|
|
|
-#undef MAX
|
|
-#define MAX(x, y) ((x) < (y) ? (y) : (x))
|
|
-
|
|
/* Socket object documentation */
|
|
PyDoc_STRVAR(sock_doc,
|
|
"socket([family[, type[, proto]]]) -> socket object\n\
|
|
@@ -2844,7 +2841,7 @@ Convert a 32-bit integer from network to
|
|
static PyObject *
|
|
socket_htons(PyObject *self, PyObject *args)
|
|
{
|
|
- unsigned long x1, x2;
|
|
+ int x1, x2;
|
|
|
|
if (!PyArg_ParseTuple(args, "i:htons", &x1)) {
|
|
return NULL;
|
|
@@ -2915,7 +2912,7 @@ socket_inet_aton(PyObject *self, PyObjec
|
|
struct in_addr buf;
|
|
#else
|
|
/* Have to use inet_addr() instead */
|
|
- unsigned long packed_addr;
|
|
+ int packed_addr;
|
|
#endif
|
|
char *ip_addr;
|
|
|
|
@@ -3046,7 +3043,7 @@ socket_inet_ntop(PyObject *self, PyObjec
|
|
#endif
|
|
|
|
/* Guarantee NUL-termination for PyString_FromString() below */
|
|
- memset((void *) &ip[0], '\0', sizeof(ip) + 1);
|
|
+ memset((void *) &ip[0], '\0', sizeof(ip));
|
|
|
|
if (!PyArg_ParseTuple(args, "is#:inet_ntop", &af, &packed, &len)) {
|
|
return NULL;
|