Commit ab429b30 authored by Olivier Teulière's avatar Olivier Teulière

* skins2/src/theme_repository.cpp: do not use pointers on temporary strings.

   Fixes #337.
parent 3a0a0ec7
...@@ -126,10 +126,15 @@ void ThemeRepository::parseDirectory( const string &rDir ) ...@@ -126,10 +126,15 @@ void ThemeRepository::parseDirectory( const string &rDir )
msg_Dbg( getIntf(), "found skin %s", path.c_str() ); msg_Dbg( getIntf(), "found skin %s", path.c_str() );
// Add the theme in the popup menu // Add the theme in the popup menu
val.psz_string = (char*)path.c_str(); string shortname = name.substr( 0, name.size() - 4 );
text.psz_string = (char*)name.substr(0, name.size() - 4).c_str(); 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() );
var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val, var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val,
&text ); &text );
delete[] val.psz_string;
delete[] text.psz_string;
} }
pDirContent = (dirent*)readdir( pDir ); pDirContent = (dirent*)readdir( pDir );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment