changeset 1301:df5d07d7ca7c

AdPlug database loading fix by Christian "Joker" Birchinger.
author Tony Vroon <chainsaw@gentoo.org>
date Thu, 19 Jul 2007 20:59:31 +0100
parents c198ae31bb74
children 1d3b02d1842b
files src/adplug/adplug-xmms.cc
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/adplug/adplug-xmms.cc	Thu Jul 19 12:56:04 2007 -0500
+++ b/src/adplug/adplug-xmms.cc	Thu Jul 19 20:59:31 2007 +0100
@@ -1064,15 +1064,10 @@
 
     if (homedir)
     {
-      char *userdb =
-        (char *) malloc (strlen (homedir) + strlen (ADPLUG_CONFDIR) +
-                         strlen (ADPLUGDB_FILE) + 3);
-      strcpy (userdb, homedir);
-      strcat (userdb, "/" ADPLUG_CONFDIR "/");
-      strcat (userdb, ADPLUGDB_FILE);
+      std::string userdb;
+      userdb = "file://" + std::string(g_get_home_dir()) + "/" ADPLUG_CONFDIR "/" + ADPLUGDB_FILE;
       plr.db->load (userdb);    // load user's database
-      dbg_printf (" (userdb=\"%s\")", userdb);
-      free (userdb);
+      dbg_printf (" (userdb=\"%s\")", userdb.c_str());
     }
   }
   CAdPlug::set_database (plr.db);