Updated addon repository URL and improved debug output on download
[supertux.git] / src / addon / addon_manager.cpp
index 60099bf..7266c3e 100644 (file)
@@ -48,7 +48,6 @@ MD5 md5_from_file(const std::string& filename)
 
   MD5 md5;
 
-  unsigned char buffer[1024];
   PHYSFS_file* file = PHYSFS_openRead(filename.c_str());
   if (!file)
   {
@@ -60,6 +59,7 @@ MD5 md5_from_file(const std::string& filename)
   {
     while (true)
     {
+      unsigned char buffer[1024];
       PHYSFS_sint64 len = PHYSFS_read(file, buffer, 1, sizeof(buffer));
       if (len <= 0) break;
       md5.update(buffer, len);
@@ -84,7 +84,7 @@ AddonManager::AddonManager(const std::string& addon_directory,
                            std::vector<Config::Addon>& addon_config) :
   m_downloader(),
   m_addon_directory(addon_directory),
-  m_repository_url("http://addons.supertux.googlecode.com/git/index-0_4_0.nfo"),
+  m_repository_url("https://raw.githubusercontent.com/SuperTuxTeam/addons/master/index-0_4_0.nfo"),
   m_addon_config(addon_config),
   m_installed_addons(),
   m_repository_addons(),