mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-07-19 16:24:45 -04:00
update ability/sbuf/src/hdf_sbuf.c.
This commit is contained in:
@@ -414,7 +414,7 @@ struct HdfSBuf *HdfSBufCopy(const struct HdfSBuf *sbuf)
|
||||
new->capacity = sbuf->capacity;
|
||||
new->readPos = 0;
|
||||
new->writePos = sbuf->writePos;
|
||||
if (memcpy_s(new->data, new->capacity, sbuf->data, sbuf->capacity) != EOK) {
|
||||
if (memcpy_s(new->data, new->capacity, sbuf->data, sbuf->writePos) != EOK) {
|
||||
HdfSBufRecycle(new);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user