changeset 376:cfc55df37ceb

Fix sizeof(char *) -> strlen() thinko. (No test case yet, but it was picked up by valgrind on 32-bit x86, which is good enough)
author mas01cr
date Fri, 14 Nov 2008 21:15:02 +0000
parents 336e4b74adc8
children 61b40ed4dc62
files audioDB.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/audioDB.cpp	Fri Nov 14 15:50:09 2008 +0000
+++ b/audioDB.cpp	Fri Nov 14 21:15:02 2008 +0000
@@ -1320,7 +1320,7 @@
         if (open(path, O_EXCL) != -1){
 
             mydbp=(adb_ptr)malloc(sizeof(adb));
-            mydbp->dbname=(char *)malloc(sizeof(path));
+            mydbp->dbname=(char *)malloc(1+strlen(path));
 
             strcpy(mydbp->dbname,path);