Signed-off-by: sunjingqiang <17319862417@163.com>
This commit is contained in:
sunjingqiang 2023-12-05 11:21:25 +08:00
parent 669e3eb7c0
commit 323bf3905c
2 changed files with 1 additions and 5 deletions

View File

@ -18,7 +18,6 @@ module_output_path = "wifi/base_test"
config("module_private_config") {
visibility = [ ":*" ]
include_dirs = [
"//commonlibrary/c_utils/base/include",
"$WIFI_ROOT_DIR/test/wifi_standard/wifi_base",
]
}
@ -41,7 +40,6 @@ ohos_unittest("base_unittest") {
include_dirs = [
"$WIFI_ROOT_DIR/base/cRPC/include",
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
]
ldflags = [

View File

@ -93,7 +93,7 @@ static int ExpandReadCache(Context *context, int len)
capacity += context->rCapacity;
left += context->rCapacity;
}
std::string *p = std::string(reinterpret_cast<char *>calloc(capacity, sizeof(char)));
char *p = (char *)calloc(capacity, sizeof(char));
if (p == nullptr) {
return -1;
}
@ -106,13 +106,11 @@ static int ExpandReadCache(Context *context, int len)
free(p);
return -1;
}
std::string *pFree = std::string(context->szRead);
context->szRead = p;
if (context->rBegin > context->rEnd) {
context->rEnd += context->rCapacity;
}
context->rCapacity = capacity;
free(pFree);
}
return 0;
}