backtrace: fix off-by-one on string output
commitecc0970e3e517b620ea63f0e35632c7d21d35da0
authorRob Norris <robn@despairlabs.com>
Fri, 13 Dec 2024 18:12:14 +0000 (14 05:12 +1100)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 18:12:14 +0000 (13 10:12 -0800)
tree96363e1fd31e41a10e2c757e9a6d02760b886e70
parent6c9b4f18d3e62d7e2562d2f101b9e1bc488abb63
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
lib/libspl/backtrace.c