summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Parser/tokenizer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index d7a223a..aaed637 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -346,7 +346,8 @@ fp_readl(char *s, int size, struct tok_state *tok)
PyObject* utf8;
PyObject* buf = tok->decoding_buffer;
if (buf == NULL) {
- PyObject *args = PyTuple_New(0);
+ /* Ask for one less byte so we can terminate it */
+ PyObject *args = Py_BuildValue("(i)", size-1);
if (args == NULL)
return error_ret(tok);
buf = PyObject_Call(tok->decoding_readline, args, NULL);