This commit is contained in:
azw 2023-05-13 03:14:00 +00:00
parent b08e735f3c
commit 0cda98b651

View File

@ -44,7 +44,10 @@ namespace a8
BufHead* buf_head = (BufHead*)(p - sizeof(BufHead));
head_ += sizeof(BufHead) + buf_head->len;
if (head_ >= buf_len_) {
capacity_ += sizeof(BufHead) + buf_head->len + (buf_len_ - head_);
head_ = 0;
} else {
capacity_ += sizeof(BufHead) + buf_head->len;
}
} else {
free(p);