Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Unified Diff: Modules/_ctypes/stgdict.c

Issue 10744: ctypes arrays have incorrect buffer information (PEP-3118)
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Modules/_ctypes/ctypes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Modules/_ctypes/stgdict.c Sat May 10 13:24:58 2014 -0400
+++ b/Modules/_ctypes/stgdict.c Sun May 11 00:04:50 2014 +0300
@@ -505,7 +505,12 @@
sprintf(buf, "%s:%s:", fieldfmt, fieldname);
ptr = stgdict->format;
- stgdict->format = _ctypes_alloc_format_string(stgdict->format, buf);
+ if (dict->shape != NULL) {
+ stgdict->format = _ctypes_alloc_format_string_with_shape(
+ dict->ndim, dict->shape, stgdict->format, buf);
+ } else {
+ stgdict->format = _ctypes_alloc_format_string(stgdict->format, buf);
+ }
PyMem_Free(ptr);
PyMem_Free(buf);
« no previous file with comments | « Modules/_ctypes/ctypes.h ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+