summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-04-01 19:56:03 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-04-01 19:56:03 +0000
commit120c38552fa36fd4c9ae37878b75a0c5f01d747c (patch)
treeac0d93677da7514dde29e1a687df73ba76f08ff7 /numpy/core/src
parentb1581395f43e19729c640cfbb8f5b328a1bb5ef1 (diff)
downloadnumpy-120c38552fa36fd4c9ae37878b75a0c5f01d747c.tar.gz
Apply patch to fix ticket #483 regarding junk at the end of an expression (which probably was introduced after recent changes to string comparisons) and handling of NULLs inside strings.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/arraytypes.inc.src5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src
index dda7aba87..844890434 100644
--- a/numpy/core/src/arraytypes.inc.src
+++ b/numpy/core/src/arraytypes.inc.src
@@ -637,7 +637,10 @@ VOID_setitem(PyObject *op, char *ip, PyArrayObject *ap)
}
res = PyObject_AsReadBuffer(op, &buffer, &buflen);
if (res == -1) goto fail;
- memcpy(ip, buffer, MIN(buflen, itemsize));
+ memcpy(ip, buffer, NPY_MIN(buflen, itemsize));
+ if (itemsize > buflen) {
+ memset(ip+buflen, 0, (itemsize-buflen));
+ }
}
return 0;