Skip to content

Commit 461b878

Browse files
committed
Oops, fix off-by-one error
1 parent ae3e408 commit 461b878

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Modules/_io/bufferedio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ _buffered_readline(buffered *self, Py_ssize_t limit)
12821282
start = self->buffer;
12831283
const char *newline = memchr(start, '\n', n);
12841284
if (newline != NULL) {
1285-
n = newline - start;
1285+
n = newline - start + 1;
12861286
if (PyBytesWriter_WriteBytes(writer, start, n) < 0) {
12871287
goto error;
12881288
}

0 commit comments

Comments
 (0)