summaryrefslogtreecommitdiff
path: root/src/plugins/python
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-05-07 08:56:12 +0200
committerSebastien Helleu <flashcode@flashtux.org>2013-05-07 08:56:12 +0200
commitc6fdeaf7e57dd671260e4a9222d2334e7a25184e (patch)
tree022c10b053251a3302d0aed35e5e799a885c794d /src/plugins/python
parent9f08029361e6ea8033600217911ae1ab81fde3af (diff)
downloadweechat-c6fdeaf7e57dd671260e4a9222d2334e7a25184e.zip
python: fix crash when loading scripts with Python 3.x (patch #8044) (thanks to isak)
Diffstat (limited to 'src/plugins/python')
-rw-r--r--src/plugins/python/weechat-python.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c
index 7c8c09cb0..becd762ab 100644
--- a/src/plugins/python/weechat-python.c
+++ b/src/plugins/python/weechat-python.c
@@ -618,7 +618,7 @@ weechat_python_load (const char *filename)
python_current_interpreter = Py_NewInterpreter ();
#if PY_MAJOR_VERSION >= 3
/* python >= 3.x */
- len = strlen (argv[0]);
+ len = mbstowcs (NULL, argv[0], 0) + 1;
wargv[0] = malloc ((len + 1) * sizeof (wargv[0][0]));
if (wargv[0])
{