1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-21 18:36:39 +02:00

clean some code

This commit is contained in:
Emmanuel Bouthenot
2006-02-12 01:31:35 +00:00
parent e7fd1a0cb7
commit 00eef1c1bc
4 changed files with 44 additions and 30 deletions
+7 -6
View File
@@ -999,7 +999,7 @@ PyMethodDef weechat_python_funcs[] = {
static PyObject *
weechat_python_output (PyObject *self, PyObject *args)
{
char *msg;
char *msg, *p;
/* make gcc happy */
(void) self;
@@ -1013,11 +1013,12 @@ weechat_python_output (PyObject *self, PyObject *args)
return NULL;
}
while (strlen(msg) > 0 && msg[strlen(msg)-1] == '\n')
msg[strlen(msg)-1] = '\0';
python_plugin->printf_server (python_plugin,
"Python stdin/stdout: %s", msg);
while ((p = strrchr(msg, '\n')) != NULL)
*p = '\0';
if (strlen(msg) > 0)
python_plugin->printf_server (python_plugin,
"Python stdin/stdout: %s", msg);
return Py_BuildValue ("i", 1);
}