read_line returning the number of bytes read instead of the bytes is a C thing. That's just how you do things in C.
Not arguing it's the best way -- and I far prefer the C++ way of returning a string or a buffer -- but it's the C way.
Not arguing it's the best way -- and I far prefer the C++ way of returning a string or a buffer -- but it's the C way.
But it really is a C thing, because that’s just “how you do it” in C.