mirror of
https://git.proxmox.com/git/mirror_zfs
synced 2025-04-28 11:40:17 +00:00
backtrace: fix off-by-one on string output
sizeof("foo") includes the trailing null byte, so all the output had nulls through it. Most terminals quietly ignore it, but it makes some tools misdetect file types and other annoyances. Easy fix: subtract 1. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16862
This commit is contained in:
parent
6c9b4f18d3
commit
ecc0970e3e
@ -38,7 +38,7 @@
|
||||
*/
|
||||
#define spl_bt_write_n(fd, s, n) \
|
||||
do { ssize_t r __maybe_unused = write(fd, s, n); } while (0)
|
||||
#define spl_bt_write(fd, s) spl_bt_write_n(fd, s, sizeof (s))
|
||||
#define spl_bt_write(fd, s) spl_bt_write_n(fd, s, sizeof (s)-1)
|
||||
|
||||
#if defined(HAVE_LIBUNWIND)
|
||||
#define UNW_LOCAL_ONLY
|
||||
|
Loading…
Reference in New Issue
Block a user