启停功能

Signed-off-by: s30035957 <sunwei158@huawei.com>
This commit is contained in:
HarrySunV9x 2024-09-18 17:30:29 +08:00
parent 6142e0a493
commit 7d6dbd422e

View File

@ -147,10 +147,9 @@ namespace OHOS {
}
std::size_t startPosition = start + 1;
std::size_t length = end - start - 1;
std::size_t length = end > start ? end - start - 1 : 0;
if (length < 0 || startPosition >= receiveBuffer.size() ||
length > receiveBuffer.size() - startPosition) {
if (startPosition >= receiveBuffer.size() || length > receiveBuffer.size() - startPosition) {
processFlag = false;
break;
}