That's bad API design, pure and simple. The function should e.g. return the string including the line terminator, and only return an empty (or null) string upon EOF.
I'd say it should throw upon EOF as it is pretty high-level convenience function.
That's bad API design, pure and simple. The function should e.g. return the string including the line terminator, and only return an empty (or null) string upon EOF.
I'd say it should throw upon EOF as it is pretty high-level convenience function.