if( psz_modules && *psz_modules && psz_control && *psz_control )
{
- psz_modules = (char *)realloc( psz_modules, strlen( psz_modules ) +
- strlen( psz_control ) + 1 );
- sprintf( psz_modules, "%s:%s", psz_modules, psz_control );
+ char* psz_tmp;
+ if( asprintf( &psz_tmp, "%s:%s", psz_modules, psz_control ) != -1 )
+ {
+ free( psz_modules );
+ psz_modules = psz_tmp;
+ }
}
else if( psz_control && *psz_control )
{
* Always load the hotkeys interface if it exists
*/
libvlc_InternalAddIntf( p_libvlc, "hotkeys,none" );
-#ifdef WIN32
- libvlc_InternalAddIntf( p_libvlc, "globalhotkeys,none" );
-#endif
+ if( module_exists( "globalhotkeys" ) )
+ libvlc_InternalAddIntf( p_libvlc, "globalhotkeys,none" );
#ifdef HAVE_DBUS
/* loads dbus control interface if in one-instance mode