| 5bf28159 | 12-Jun-2017 |
Enji Cooper <[email protected]> |
Remove stdlib.h #include added in r319844
A previous iteration of the tests I added in r319844 involved free(3), but that attempt didn't pan out, so I switched to stack allocated buffers instead of
Remove stdlib.h #include added in r319844
A previous iteration of the tests I added in r319844 involved free(3), but that attempt didn't pan out, so I switched to stack allocated buffers instead of heap allocated ones, making the #include unnecessary.
MFC after: 1 month MFC with: r319844
show more ...
|
| 33193da2 | 29-Mar-2017 |
Enji Cooper <[email protected]> |
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[] i
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).
MFC after: 2 months Noted by: cem Sponsored by: Dell EMC Isilon
show more ...
|