[klibc] fwrite: use memrchr() to find the final '\n' in _IOLBF mode

In line buffered mode, we need to split the write at the final '\n'
(which usually, but not always, is the last character in the string.)

Use memrchr() instead of open-coding it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1 file changed