[Numpy-svn] r3634 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Sun Apr 1 14:56:05 CDT 2007


Author: oliphant
Date: 2007-04-01 14:56:03 -0500 (Sun, 01 Apr 2007)
New Revision: 3634

Modified:
   trunk/numpy/core/src/arraytypes.inc.src
Log:
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.

Modified: trunk/numpy/core/src/arraytypes.inc.src
===================================================================
--- trunk/numpy/core/src/arraytypes.inc.src	2007-04-01 19:49:58 UTC (rev 3633)
+++ trunk/numpy/core/src/arraytypes.inc.src	2007-04-01 19:56:03 UTC (rev 3634)
@@ -637,7 +637,10 @@
                 }
                 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;
 



More information about the Numpy-svn mailing list