From: Mark Wooding Date: Sun, 4 Oct 2009 12:32:43 +0000 (+0100) Subject: fdutils.pyx, str.pyx: Fix some stupid bugs. X-Git-Tag: 1.0.2~3 X-Git-Url: https://git.distorted.org.uk/~mdw/mLib-python/commitdiff_plain/23bff39b96e98bc1969d275bc7c43e1d6dd28429?hp=4af382cb5e0ef75e56002b07afcf5868e92393e6 fdutils.pyx, str.pyx: Fix some stupid bugs. 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. --- 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))