]> git.sesse.net Git - vlc/commitdiff
skins2: simplification.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 26 Feb 2009 10:23:32 +0000 (11:23 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 26 Feb 2009 17:01:25 +0000 (18:01 +0100)
modules/gui/skins2/src/theme_repository.cpp

index 3db8a424bd7e53b418870cca251405e09aba8b10..8aef4e60f971598e1f80d67b8851dfe29a9babac 100644 (file)
@@ -131,14 +131,12 @@ void ThemeRepository::parseDirectory( const string &rDir_locale )
 
             // Add the theme in the popup menu
             string shortname = name.substr( 0, name.size() - 4 );
-            val.psz_string = new char[path.size() + 1];
-            text.psz_string = new char[shortname.size() + 1];
-            strcpy( val.psz_string, path.c_str() );
-            strcpy( text.psz_string, shortname.c_str() );
+            val.psz_string = strdup( path.c_str() );
+            text.psz_string = strdup( shortname.c_str() );
             var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val,
                         &text );
-            delete[] val.psz_string;
-            delete[] text.psz_string;
+            free( val.psz_string );
+            free( text.psz_string );
         }
 
         free( pszDirContent );