changeset 202:7c9feaceeab5

Fix test 0034 Include the key's trailing null character in the string comparison.
author mas01cr
date Tue, 27 Nov 2007 18:14:19 +0000
parents b5087d00b062
children 4b05c5bbf06d 7562a833a951
files audioDB.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/audioDB.cpp	Tue Nov 27 18:13:48 2007 +0000
+++ b/audioDB.cpp	Tue Nov 27 18:14:19 2007 +0000
@@ -627,7 +627,7 @@
   // Linear scan of filenames check for pre-existing feature
   unsigned alreadyInserted=0;
   for(unsigned k=0; k<dbH->numFiles; k++)
-    if(strncmp(fileTable + k*O2_FILETABLESIZE, key, strlen(key))==0){
+    if(strncmp(fileTable + k*O2_FILETABLESIZE, key, strlen(key)+1)==0){
       alreadyInserted=1;
       break;
     }
@@ -823,7 +823,7 @@
     unsigned alreadyInserted=0;
   
     for(unsigned k=0; k<dbH->numFiles; k++)
-      if(strncmp(fileTable + k*O2_FILETABLESIZE, thisKey, strlen(thisKey))==0){
+      if(strncmp(fileTable + k*O2_FILETABLESIZE, thisKey, strlen(thisKey)+1)==0){
 	alreadyInserted=1;
 	break;
       }