use the new function in vmbus driver and kvp driver
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2908 Build 2934: arc lint + arc unit
Event Timeline
sys/dev/hyperv/include/hyperv.h | ||
---|---|---|
127 | Add "const" for "hv_guid *" | |
sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c | ||
305 | add "const" for the guid pointer. | |
308 | add "const unsigned" for d. | |
312 | It should be See https://en.wikipedia.org/wiki/Globally_unique_identifier (the first 4+2+2 bytes are in little endian on x86) | |
314 | before "return", add KASSERT(cnt < sz, ("snprintf_hv_guid: too small buf: cnt=%d!\n", cnt)); |
Add const and KASSERT too?
Just to make sure people can't pass a too small buf size by mistake (the exact buf size needed here is 37).
I didn't see your comments before I made the change. I added const.
Just to make sure people can't pass a too small buf size by mistake (the exact buf size needed here is 37).
I don't agree on this since snprintf in general should not panic if buf is not enough. this function should inherit that behavior.