# HG changeset patch # User mas01cr # Date 1196187259 0 # Node ID 7c9feaceeab55e9c4b6b0683a81391eca562db07 # Parent b5087d00b062fd6e05c908befd3b1e6f0e186e4c Fix test 0034 Include the key's trailing null character in the string comparison. diff -r b5087d00b062 -r 7c9feaceeab5 audioDB.cpp --- 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; knumFiles; 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; knumFiles; 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; }