提交 53230a08 编写于 作者: O openharmony_ci 提交者: Gitee

!34 【轻量级 PR】:remove meaningless null-checking code

Merge pull request !34 from Gymee/N/A
......@@ -28,8 +28,12 @@ const unsigned int PREFIX_LEN = strlen(FILE_PREFIX);
bool IsValidPath(const char* path)
{
if (path == nullptr) {
return false;
}
size_t pathLen = strnlen(path, URI_NAME_MAX_LEN + 1);
if ((path == nullptr) || (pathLen > URI_NAME_MAX_LEN)) {
if (pathLen > URI_NAME_MAX_LEN) {
return false;
}
if ((pathLen < PREFIX_LEN) || (strncmp(path, FILE_PREFIX, PREFIX_LEN) != 0)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册