From f2c9961a21ad56cc5f6440e2dd661a588188c149 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 16 Dec 2010 14:27:16 +0100 Subject: Fix crash in perl plugin when MULTIPLICITY is disabled --- src/plugins/scripts/perl/weechat-perl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index 73693d2b4..3b0ea5f37 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -275,11 +275,14 @@ weechat_perl_exec (struct t_plugin_script *script, if (script->interpreter) PERL_SET_CONTEXT (script->interpreter); #else - length = strlen (script->interpreter) + strlen (function) + 3; + length = strlen ((script->interpreter) ? script->interpreter : perl_main) + + strlen (function) + 3; func = (char *) malloc (length); if (!func) return NULL; - snprintf (func, length, "%s::%s", (char *) script->interpreter, function); + snprintf (func, length, "%s::%s", + (char *) ((script->interpreter) ? script->interpreter : perl_main), + function); #endif ENTER; -- cgit v1.2.3