summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-06-20 23:28:40 +0200
committerFlorent Le Coz <louiz@louiz.org>2013-06-20 23:28:40 +0200
commitd81568eebe72f7c94df297d4482f5b612f425f6b (patch)
tree56fe30a2d0b2e3035da888aeed14d19b055964ff /src
parentee0c29ada131046ddedadd2bccaf09ec14cf09f2 (diff)
downloadpoezio-d81568eebe72f7c94df297d4482f5b612f425f6b.tar.gz
poezio-d81568eebe72f7c94df297d4482f5b612f425f6b.tar.bz2
poezio-d81568eebe72f7c94df297d4482f5b612f425f6b.tar.xz
poezio-d81568eebe72f7c94df297d4482f5b612f425f6b.zip
Use a logical order of arguments in the poopt functions, now
Diffstat (limited to 'src')
-rw-r--r--src/pooptmodule.c4
-rw-r--r--src/windows.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pooptmodule.c b/src/pooptmodule.c
index 43e4ff7c..7593d377 100644
--- a/src/pooptmodule.c
+++ b/src/pooptmodule.c
@@ -42,7 +42,7 @@ static PyObject* poopt_cut_text(PyObject* self, PyObject* args)
const char* buffer;
const int buffer_len;
- if (PyArg_ParseTuple(args, "ks#", &width, &buffer, &buffer_len) == 0)
+ if (PyArg_ParseTuple(args, "s#k", &buffer, &buffer_len, &width) == 0)
return NULL;
/* Pointer to the end of the string */
@@ -223,7 +223,7 @@ static PyObject* poopt_cut_by_columns(PyObject* self, PyObject* args)
const char* start;
const int len;
const size_t limit;
- if (PyArg_ParseTuple(args, "ks#", &limit, &start, &len) == 0)
+ if (PyArg_ParseTuple(args, "s#k", &start, &len, &limit) == 0)
return NULL;
const char* const end = start + len;
diff --git a/src/windows.py b/src/windows.py
index b0ba845e..76137d85 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -269,7 +269,7 @@ class UserList(Win):
for user in users[self.pos:]:
self.draw_role_affiliation(y, user)
self.draw_status_chatstate(y, user)
- self.addstr(y, 2, poopt.cut_by_columns(self.width-2, user.nick), to_curses_attr(user.color))
+ self.addstr(y, 2, poopt.cut_by_columns(user.nick, self.width-2), to_curses_attr(user.color))
if config.get('user_list_sort', 'desc').lower() == 'asc':
y -= 1
else:
@@ -888,7 +888,7 @@ class TextWin(Win):
offset += 1
if get_theme().CHAR_TIME_RIGHT and message.str_time:
offset += 1
- lines = poopt.cut_text(self.width-offset-1, txt)
+ lines = poopt.cut_text(txt, self.width-offset-1)
prepend = ''
attrs = []
for line in lines: