提交 85c3b143 编写于 作者: W wu-chengwen

fix:memcpy_s param error

Signed-off-by: Nwu-chengwen <wuchengwen4@huawei.com>
上级 fa63642a
...@@ -954,7 +954,7 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) ...@@ -954,7 +954,7 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp)
return (ENOMEM); return (ENOMEM);
PDEBUG(("start memcpy, size %d", sizeof(device_t) * dc->maxunit)); PDEBUG(("start memcpy, size %d", sizeof(device_t) * dc->maxunit));
if (oldlist != NULL) if (oldlist != NULL)
(void)memcpy_s(oldlist, sizeof(device_t) * dc->maxunit, newlist, sizeof(device_t) * dc->maxunit); (void)memcpy_s(newlist, sizeof(device_t) * dc->maxunit, oldlist, sizeof(device_t) * dc->maxunit);
PDEBUG(("start memset, maxunit %d, size %d", dc->maxunit, sizeof(device_t) * (newsize - dc->maxunit))); PDEBUG(("start memset, maxunit %d, size %d", dc->maxunit, sizeof(device_t) * (newsize - dc->maxunit)));
(void)memset_s(newlist + dc->maxunit, sizeof(device_t) * (newsize - dc->maxunit), 0, (void)memset_s(newlist + dc->maxunit, sizeof(device_t) * (newsize - dc->maxunit), 0,
sizeof(device_t) * (newsize - dc->maxunit)); sizeof(device_t) * (newsize - dc->maxunit));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册