stdout is correct, the comment says `Read lines from stdin into a buffer... write the buffer to stdout.`

This is the reading part.

And the `idup` is necessary, because the buffer is reused.  I think you are misreading something.