diff --git a/C_Language/weechat_plugins/currentsong.c b/C_Language/weechat_plugins/currentsong.c index 3a3d48c..18ab573 100644 --- a/C_Language/weechat_plugins/currentsong.c +++ b/C_Language/weechat_plugins/currentsong.c @@ -77,7 +77,14 @@ int cb_currentsong_plugin(void *data, struct t_gui_buffer *buffer, int argc, cha wait(&status); if(WEXITSTATUS(status) != 0) - sprintf(song,"didn't worked !!!"); + { + for(i = 0 ; i < TAILLE_BUFFER_CURRENT_SONG ; i++) + song[i] = '\0'; + sprintf(song,"/currentsong didn't work !!! You should probably use the 'host ' or 'port num' option"); + sprintf(affichage,"pluginerr\t%s",song); + weechat_printf(buffer,affichage); + return WEECHAT_RC_ERROR; + } sprintf(affichage,"/me ♪ %s", song); //sprintf(affichage,"/me ♪ %s%s", weechat_color ("_red"), song); // Ne s'affiche pas correctement chez les autres @@ -101,7 +108,7 @@ int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[] weechat_hook_command ("currentsong", "Affiche le morceau que vous écoutez", "[host ip]", - "si mpd n'est pas en local : host ", + "si mpd n'est pas en local : host ", "host ", &cb_currentsong_plugin, NULL);