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

numpy-svn@scip... numpy-svn@scip...
Mon Mar 26 17:28:10 CDT 2007


Author: oliphant
Date: 2007-03-26 17:28:04 -0500 (Mon, 26 Mar 2007)
New Revision: 3605

Modified:
   trunk/numpy/core/src/arrayobject.c
Log:
Fix ticket #476: string comparisons with leading NULL

Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2007-03-26 22:13:28 UTC (rev 3604)
+++ trunk/numpy/core/src/arrayobject.c	2007-03-26 22:28:04 UTC (rev 3605)
@@ -4297,7 +4297,7 @@
         int val;
         int diff;
 
-        val = strncmp(s1, s2, MIN(len1, len2));
+        val = memcmp(s1, s2, MIN(len1, len2));
         if ((val != 0) || (len1 == len2)) return val;
         if (len2 > len1) {sptr = s2+len1; val = -1; diff=len2-len1;}
         else {sptr = s1+len2; val = 1; diff=len1-len2;}



More information about the Numpy-svn mailing list