NetBSD/lib/libutil
rillig 69c5b3b0c1 snprintb: always null-terminate output
Always null-terminate the output in the buffer, even in error cases. The
wording in the manual page has been promising this since 2008. For
snprintb_m, ensure that the output is terminated with two null
characters, to gracefully handle situations in which the caller does not
check whether snprintb returned an error.

If the buffer size is zero, allow the buffer to be a null pointer,
analogous to snprintf.

Fix an out-of-bounds memory read if the bitfmt ends with a '*' directive
(since today).

In the tests, merge the helper functions for snprintb, snprintb_m, as
they were similar enough.

Fix a few 'line_max exceeded' tests, ensuring that they output a '#'
marker, and that the 'complete' tests don't.
2024-02-22 21:04:23 +00:00
..
compat
Makefile bsd.own.mk: rename GCC_NO_* to CC_WNO_* 2023-06-03 09:09:01 +00:00
disklabel_dkcksum.3
disklabel_dkcksum.c
disklabel_scan.3
disklabel_scan.c
efun.3
efun.c annotate __dead 2019-10-03 20:29:19 +00:00
getbootfile.3
getbootfile.c
getbyteorder.3
getbyteorder.c
getdiskrawname.3 s/ the the / the / 2019-03-08 08:12:39 +00:00
getdiskrawname.c Teach getdiskrawname and getdiskcookedname about zvols. 2019-08-22 20:23:43 +00:00
getfsspecname.3 Document "ROOT." syntax before documenting a generic . 2018-12-28 18:44:11 +00:00
getfsspecname.c No need to quadruple a buffer because strunvis(3) doesn't expand. 2018-12-27 21:35:48 +00:00
getfstypename.3
getlabelsector.3
getlabelsector.c
getmaxpartitions.3
getmaxpartitions.c
getmntopts.3 Sections 2 and 3 have RETURN VALUES, not DIAGNOSTICS 2022-12-04 01:29:31 +00:00
getmntopts.c
getrawpartition.3 getrawpartition(3): reword to clarify return value, use .Pq 2024-02-04 18:44:54 +00:00
getrawpartition.c
if_media.c
kinfo_getvmmap.3
kinfo_getvmmap.c
login.3
login.c
login_cap.3 login_cap(3): Markup fixes 2022-12-04 22:51:43 +00:00
login_cap.c
login_tty.c
loginx.3
loginx.c
logout.c
logoutx.c
logwtmp.c
logwtmpx.c
opendisk.3 Use mdoc macros. 2018-04-05 11:07:00 +00:00
opendisk.c
openpty.3
parsedate.3 PR bin/56042 2021-05-16 19:42:35 +00:00
parsedate.y fix date -d 12/01/2022, found by Anon Ymous 2022-04-23 13:02:04 +00:00
passwd.c Prevent underflow buffer read in trim_whitespace() in libutil/passwd.c 2018-06-24 01:53:14 +00:00
pidfile.3
pidfile.c fix typos in word "otherwise". 2021-08-01 15:29:29 +00:00
pidlock.3 Sort errors. 2017-10-23 01:05:10 +00:00
pidlock.c fail to create a pidfile if hostname contains '/' 2020-03-30 08:24:36 +00:00
proc_compare.3
pty.c Fix stack use after scope in libutil/pty 2018-06-24 09:30:26 +00:00
pw_getconf.3
pw_init.3 pw_init(3): Use .Ev for EDITOR 2022-12-04 11:16:39 +00:00
pw_lock.3
raise_default_signal.3
raise_default_signal.c
secure_path.3
secure_path.c
shlib_version
snprintb.3 snprintb: always null-terminate output 2024-02-22 21:04:23 +00:00
sockaddr_snprintf.3 lib: Mark up error names in man pages with .Er 2022-12-04 11:25:08 +00:00
sockaddr_snprintf.c
stat_flags.3 stat_flags(3): try to improve the descriptions 2023-05-31 21:49:39 +00:00
stat_flags.c lib: remove CONSTCOND comment 2022-04-19 20:32:14 +00:00
strpct.3
strpct.c
ttyaction.3 note that ttyaction.[35] first appeared in netbsd 1.3. 2021-03-21 23:29:36 +00:00
ttyaction.c
ttymsg.3
ttymsg.c
util.3 s/ the the / the / 2019-03-08 08:12:39 +00:00