mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
hv:fix "missing for discarded return value" for memcpy_s and strcpy_s
It will print error information inside memcpy_s if the parameteter is invalid, the caller can not check the return value for memcpy_s/strcpy_s/strncpy_s code like this: int a(void) { return 0; } int b(void){ a(); } fix as follow: int a(void) { return 0; } int b(void){ (void)a(); } Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
@@ -94,7 +94,7 @@ int sbuf_get(struct shared_buf *sbuf, uint8_t *data)
|
||||
|
||||
from = (void *)sbuf + SBUF_HEAD_SIZE + sbuf->head;
|
||||
|
||||
memcpy_s((void *)data, sbuf->ele_size, from, sbuf->ele_size);
|
||||
(void)memcpy_s((void *)data, sbuf->ele_size, from, sbuf->ele_size);
|
||||
|
||||
sbuf->head = sbuf_next_ptr(sbuf->head, sbuf->ele_size, sbuf->size);
|
||||
|
||||
@@ -142,7 +142,7 @@ int sbuf_put(struct shared_buf *sbuf, uint8_t *data)
|
||||
|
||||
to = (void *)sbuf + SBUF_HEAD_SIZE + sbuf->tail;
|
||||
|
||||
memcpy_s(to, sbuf->ele_size, data, sbuf->ele_size);
|
||||
(void)memcpy_s(to, sbuf->ele_size, data, sbuf->ele_size);
|
||||
|
||||
if (trigger_overwrite) {
|
||||
sbuf->head = sbuf_next_ptr(sbuf->head,
|
||||
|
Reference in New Issue
Block a user