diff options
author | ngie <ngie@FreeBSD.org> | 2017-07-18 08:15:02 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-07-18 08:15:02 +0000 |
commit | c7011a5a1b3d6103cd31a38f677d6d77c44158d3 (patch) | |
tree | c945395db5b500babb8919fd9cda50ab96aa8a3f /lib | |
parent | 64e85b71e8a50aa56fe271bbb1ee1a7fd9a5cbb2 (diff) | |
download | FreeBSD-src-c7011a5a1b3d6103cd31a38f677d6d77c44158d3.zip FreeBSD-src-c7011a5a1b3d6103cd31a38f677d6d77c44158d3.tar.gz |
MFC r279992,r280149,r280193,r288223,r288484,r321109:
r279992 (by ian):
Add a new flag, SBUF_INCLUDENUL, and new get/set/clear functions for flags.
The SBUF_INCLUDENUL flag causes the nulterm byte at the end of the string
to be counted in the length of the data. If copying the data using the
sbuf_data() and sbuf_len() functions, or if writing it automatically with
a drain function, the net effect is that the nulterm byte is copied along
with the rest of the data.
r280149 (by ian):
Update an sbuf assertion to allow for the new SBUF_INCLUDENUL flag. If
INCLUDENUL is set and sbuf_finish() has been called, the length has been
incremented to count the nulterm byte, and in that case current length is
allowed to be equal to buffer size, otherwise it must be less than.
Add a predicate macro to test for SBUF_INCLUDENUL, and use it in tests, to
be consistant with the style in the rest of this file.
r280193 (by ian):
The minimum sbuf buffer size is 2 bytes (a byte plus a nulterm), assert that.
Values smaller than two lead to strange asserts that have nothing to do
with the actual problem (in the case of size=0), or to writing beyond the
end of the allocated buffer in sbuf_finish() (in the case of size=1).
r288223 (by cem):
sbuf: Process more than one char at a time
Revamp sbuf_put_byte() to sbuf_put_bytes() in the obvious fashion and
fixup callers.
Add a thin shim around sbuf_put_bytes() with the old ABI to avoid ugly
changes to some callers.
Obtained from: Dan Sledz
r288484 (by phk):
Fail the sbuf if vsnprintf(3) fails.
r321109:
Fix whitespace regression accidentally checked in via ^/head@r280149
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions