diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-12-16 14:27:16 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-12-16 14:27:16 +0100 |
commit | f2c9961a21ad56cc5f6440e2dd661a588188c149 (patch) | |
tree | 786c92c035dda3a0fd15b56fc37c80d8b9be2333 /src | |
parent | 29f1461c42afb595d23a3e7bbe78c91bb7c089f1 (diff) | |
download | weechat-f2c9961a21ad56cc5f6440e2dd661a588188c149.zip |
Fix crash in perl plugin when MULTIPLICITY is disabled
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl.c | 7 |
1 files changed, 5 insertions, 2 deletions
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; |