Mercurial > hg > audiodb
comparison audioDB.cpp @ 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 | 5eb5034b0577 |
children | 9742ea0ac33d |
comparison
equal
deleted
inserted
replaced
375:336e4b74adc8 | 376:cfc55df37ceb |
---|---|
1318 /* if db exists */ | 1318 /* if db exists */ |
1319 | 1319 |
1320 if (open(path, O_EXCL) != -1){ | 1320 if (open(path, O_EXCL) != -1){ |
1321 | 1321 |
1322 mydbp=(adb_ptr)malloc(sizeof(adb)); | 1322 mydbp=(adb_ptr)malloc(sizeof(adb)); |
1323 mydbp->dbname=(char *)malloc(sizeof(path)); | 1323 mydbp->dbname=(char *)malloc(1+strlen(path)); |
1324 | 1324 |
1325 strcpy(mydbp->dbname,path); | 1325 strcpy(mydbp->dbname,path); |
1326 | 1326 |
1327 audiodb_status(mydbp, &mystatus); | 1327 audiodb_status(mydbp, &mystatus); |
1328 mydbp->ntracks=mystatus.numFiles; | 1328 mydbp->ntracks=mystatus.numFiles; |