aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 6fbb14d0b..ef6cf3a5e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -331,11 +331,15 @@ int main(int argc, char * argv[]) {
initTables();
initPlaylist();
- if(!options.dbFile) {
+ if(!options.dbFile) {
strncpy(directorydb,playlistDir,MAXPATHLEN);
+ directorydb[MAXPATHLEN] = '\0';
strncat(directorydb,"/.mpddb",MAXPATHLEN-strlen(playlistDir));
}
- else strncpy(directorydb,options.dbFile,MAXPATHLEN);
+ else {
+ strncpy(directorydb,options.dbFile,MAXPATHLEN);
+ directorydb[MAXPATHLEN] = '\0';
+ }
if(options.createDB>0 || readDirectoryDB()<0) {
if(options.createDB<0) {
ERROR("can't open db file and using \"--no-create-db\""