From 23bff39b96e98bc1969d275bc7c43e1d6dd28429 Mon Sep 17 00:00:00 2001 Message-Id: <23bff39b96e98bc1969d275bc7c43e1d6dd28429.1715381535.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 4 Oct 2009 13:32:43 +0100 Subject: [PATCH] fdutils.pyx, str.pyx: Fix some stupid bugs. Organization: Straylight/Edgeware From: Mark Wooding The warning spew on general Pyrex-generated C code is heavy enough that I didn't spot the uninitialized-variable warnings in these files. Fixed the genuine (and possibly nasty) bugs. --- fdutils.pyx | 2 +- str.pyx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fdutils.pyx b/fdutils.pyx index c6ba79e..0236caf 100644 --- a/fdutils.pyx +++ b/fdutils.pyx @@ -50,7 +50,7 @@ def fdrecv(sock, unsigned size): cdef int len cdef PyObject *obj cdef int fd - buf = PyString_FromStringAndSize(NULL, len) + buf = PyString_FromStringAndSize(NULL, size) p = PyString_AS_STRING(buf) len = fdpass_recv(_getfd(sock), &fd, p, size) if len < 0: diff --git a/str.pyx b/str.pyx index a87f12c..a48b5f2 100644 --- a/str.pyx +++ b/str.pyx @@ -78,6 +78,8 @@ def split(char *p, int n = -1, quotep = False): def match(char *p, char *s, prefixp = False): cdef unsigned f + + f = 0 if prefixp: f = f | STRF_PREFIX return _tobool(str_matchx(p, s, f)) -- [mdw]