diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-11-05 12:33:50 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-11-05 12:33:50 +0100 |
commit | bc0237cd0df9a0aafceb312df5dc29e8c4ff2abf (patch) | |
tree | 5e68d4ebadb9d2a833cd9231573174f82ba03a10 /src/plugins | |
parent | 596d60b5d932ec47e00d1df35a33ae4f5cb46613 (diff) | |
download | weechat-bc0237cd0df9a0aafceb312df5dc29e8c4ff2abf.zip |
Fix crash when loading Perl scripts on FreeBSD
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index ce53758cf..67df60742 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -112,7 +112,7 @@ void * weechat_perl_exec (struct t_plugin_script *script, int ret_type, const char *function, char **argv) { - const char *func; + char *func; unsigned int count; void *ret_value; int *ret_i, mem_err, length; @@ -124,11 +124,11 @@ weechat_perl_exec (struct t_plugin_script *script, #ifdef MULTIPLICITY (void) length; - func = function; + func = (char *) function; PERL_SET_CONTEXT (script->interpreter); #else length = strlen (script->interpreter) + strlen (function) + 3; - func = malloc (length); + func = (char *) malloc (length); if (!func) return NULL; snprintf (func, length, "%s::%s", (char *) script->interpreter, function); @@ -628,10 +628,12 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) #ifdef PERL_SYS_INIT3 int a = perl_args_count; + char **perl_args_local = perl_args; char *perl_env[] = {}; (void) a; + (void) perl_args_local; (void) perl_env; - PERL_SYS_INIT3 (&a, (char ***)&perl_args, (char ***)&perl_env); + PERL_SYS_INIT3 (&a, (char ***)&perl_args_local, (char ***)&perl_env); #endif weechat_perl_plugin = plugin; |