diff --git a/CHANGELOG.md b/CHANGELOG.md index 645a599c62..5f913fce70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Please mark all change in change log and use the issue from GitHub - \#715 - Milvus crash when searching and building index simultaneously using SQ8H - \#744 - Don't return partition table for show_tables - \#770 - Server unittest run failed on low-end server +- \#831 - Judge branch error in CommonUtil.cpp ## Feature - \#216 - Add CLI to get server info diff --git a/core/src/utils/CommonUtil.cpp b/core/src/utils/CommonUtil.cpp index cdfae8f1e5..7064764590 100644 --- a/core/src/utils/CommonUtil.cpp +++ b/core/src/utils/CommonUtil.cpp @@ -190,7 +190,7 @@ CommonUtil::GetExePath() { buf[cnt] = '\0'; std::string exe_path = buf; - if (exe_path.rfind('/') != exe_path.length()) { + if (exe_path.rfind('/') != exe_path.length() - 1) { std::string sub_str = exe_path.substr(0, exe_path.rfind('/')); return sub_str + "/"; }