diff options
author | ngie <ngie@FreeBSD.org> | 2017-05-28 00:47:02 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-05-28 00:47:02 +0000 |
commit | 4e90ae005dc94b7406d625aabf890337b7c7f39f (patch) | |
tree | 2dcb34c8e7b87b3605cff7370f185529ad0ca6d8 /sys/boot/zfs/libzfs.h | |
parent | d54ba39727168452e43abbf68f4463162ab58098 (diff) | |
download | FreeBSD-src-4e90ae005dc94b7406d625aabf890337b7c7f39f.zip FreeBSD-src-4e90ae005dc94b7406d625aabf890337b7c7f39f.tar.gz |
MFC r316131:
Fix up r316081 by using nitems(cam_errbuf) instead of sizeof(cam_errbuf)
Part of my original reasoning as far as converting the snprintf
calls was to permit switching over from char[] to wchar_t[] in the
future, as well as futureproof in case cam_errbuf's size was ever
changed.
Unfortunately, my approach was bugged because it conflated the
number of items with the size of the buffer, instead of the number of
elements being a fixed size != 1 byte.
Use nitems(..) instead which counts the quantity of items of a specific
type, as opposed to an unqualified sizeof(..) (which assumes that the
number of characters is equal to the buffer size).
Noted by: cem
Diffstat (limited to 'sys/boot/zfs/libzfs.h')
0 files changed, 0 insertions, 0 deletions