未验证 提交 b03e3a81 编写于 作者: X xinsheng Ren 提交者: GitHub

FIX:TS-2258-mac cpuinfo has an extra enter character (#18916)

* FIX:TS-2258-mac cpuinfo has an extra enter character

* fix:TS-2258_static_check
Co-authored-by: Nfacetosea <25808407@qq.com>
上级 ad4c949f
......@@ -354,6 +354,10 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) {
code = 0;
done |= 1;
}
int endPos = strlen(cpuModel)-1;
if (cpuModel[endPos] == '\n') {
cpuModel[endPos] = '\0';
}
taosCloseCmd(&pCmd);
pCmd = taosOpenCmd("sysctl -n machdep.cpu.core_count");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册