HomeFreeBSD

sbuf(9): Add sbuf_nl_terminate() API

Description

sbuf(9): Add sbuf_nl_terminate() API

The API is used to gracefully terminate text line(s) with a single \n. If
the formatted buffer was empty or already ended in \n, it is unmodified.
Otherwise, a newline character is appended to it. The API, like other
sbuf-modifying routines, is only valid while the sbuf is not FINISHED.

Reviewed by: rlibby
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21030

Details

Provenance
cemAuthored on
Reviewer
rlibby
Differential Revision
D21030: sbuf(9): Add sbuf_nl_terminate() API
Parents
rS350692: sbuf(9): Refactor sbuf_newbuf into sbuf_new
Branches
Unknown
Tags
Unknown