use the new function in vmbus driver and kvp driver
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/dev/hyperv/include/hyperv.h | ||
---|---|---|
127 ↗ | (On Diff #14359) | Add "const" for "hv_guid *" |
sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c | ||
305 ↗ | (On Diff #14359) | add "const" for the guid pointer. |
308 ↗ | (On Diff #14359) | add "const unsigned" for d. |
312 ↗ | (On Diff #14359) | 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 ↗ | (On Diff #14359) | 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.