From c8ec7378b32f788d04a346c12aabb319b3627be7 Mon Sep 17 00:00:00 2001 From: Bob Eldering Date: Wed, 5 Jul 2017 17:36:23 +0200 Subject: BUG: ')' is printed at the end pointer of the buffer in numpy.f2py. When building the __doc__ string for Fortran objects, the ')' character, closing the dimensions list, is written 1 position beyond the allowed buffer size, instead of the current pointer in the buffer. --- numpy/f2py/src/fortranobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/f2py/src/fortranobject.c') diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c index 8c8b4ae5d..72854db47 100644 --- a/numpy/f2py/src/fortranobject.c +++ b/numpy/f2py/src/fortranobject.c @@ -130,8 +130,7 @@ format_def(char *buf, Py_ssize_t size, FortranDataDef def) return -1; } - p[size] = ')'; - p++; + *p++ = ')'; size--; if (def.data == NULL) { -- cgit v1.2.1