Commit 2724ab87 authored by Rémi Duraffort's avatar Rémi Duraffort

notify: use asprintf

parent df01ece2
/***************************************************************************** /*****************************************************************************
* notify.c : libnotify notification plugin * notify.c : libnotify notification plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2006-2007 the VideoLAN team * Copyright (C) 2006-2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Christophe Mutricy <xtophe -at- videolan -dot- org> * Authors: Christophe Mutricy <xtophe -at- videolan -dot- org>
...@@ -70,7 +70,7 @@ vlc_module_begin () ...@@ -70,7 +70,7 @@ vlc_module_begin ()
set_shortname( N_( "Notify" ) ) set_shortname( N_( "Notify" ) )
set_description( N_("LibNotify Notification Plugin") ) set_description( N_("LibNotify Notification Plugin") )
add_integer( "notify-timeout", 4000,NULL, add_integer( "notify-timeout", 4000, NULL,
TIMEOUT_TEXT, TIMEOUT_LONGTEXT, true ) TIMEOUT_TEXT, TIMEOUT_LONGTEXT, true )
set_capability( "interface", 0 ) set_capability( "interface", 0 )
...@@ -215,11 +215,12 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var, ...@@ -215,11 +215,12 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
} }
else /* else we show state-of-the art logo */ else /* else we show state-of-the art logo */
{ {
const char *data_path = config_GetDataDir (); char *psz_pixbuf;
char buf[strlen (data_path) + sizeof ("/vlc48x48.png")]; if( asprintf( &psz_pixbuf, "%s/vlc48x48.png", config_GetDataDir() ) >= 0 )
{
snprintf (buf, sizeof (buf), "%s/vlc48x48.png", data_path); pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
pix = gdk_pixbuf_new_from_file( buf, &p_error ); free( psz_pixbuf );
}
} }
/* we need to replace '&' with '&amp;' because '&' is a keyword of /* we need to replace '&' with '&amp;' because '&' is a keyword of
......
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