!22 【轻量级 PR】:update ability/sbuf/src/hdf_sbuf.c.

Merge pull request !22 from 冷钦街/N/A
This commit is contained in:
openharmony_ci
2021-03-29 13:01:06 +08:00
committed by Gitee
+1 -1
View File
@@ -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;
}