[Zope3-checkins] CVS: ZODB4/src/persistence - persistence.c:1.20

Jeremy Hylton jeremy@zope.com
Thu, 3 Jul 2003 15:13:00 -0400


Update of /cvs-repository/ZODB4/src/persistence
In directory cvs.zope.org:/tmp/cvs-serv2466

Modified Files:
	persistence.c 
Log Message:
Don't use strncmp().

The old code would treat "__dict__" and "__dict__perverse" as the
same thing.


=== ZODB4/src/persistence/persistence.c 1.19 => 1.20 ===
--- ZODB4/src/persistence/persistence.c:1.19	Mon Jun 30 17:31:07 2003
+++ ZODB4/src/persistence/persistence.c	Thu Jul  3 15:12:56 2003
@@ -446,15 +446,15 @@
 	switch (*s) {
 	case 'd':
 	    s++;
-	    if (!strncmp(s, "ict__", 5))
+	    if (!strcmp(s, "ict__"))
 		return 0; /* __dict__ */
-	    if (!strncmp(s, "el__", 4))
+	    if (!strcmp(s, "el__"))
 		return 0; /* __del__ */
 	    return 1;
 	case 'c':
-	    return strncmp(s, "class__", 7);
+	    return strcmp(s, "class__");
 	case 's':
-	    return strncmp(s, "setstate__", 10);
+	    return strcmp(s, "setstate__");
 	default:
 	    return 1;
 	}