buf is undefined, this should be `handle->read_line_buffer` instead of buf?