update frameworks/intl/src/utils.cpp.

Signed-off-by: wangkexin <wangkexin14@huawei.com>
This commit is contained in:
wangkexin 2024-05-20 02:33:09 +00:00 committed by Gitee
parent 4c33a1c441
commit 2d8f85e519
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -224,12 +224,12 @@ bool IsDirExist(const char *path)
if (!(path && *path)) { if (!(path && *path)) {
return false; return false;
} }
char resolved_path[PATH_MAX]; char* resolvedPath = new char[PATH_MAX];
if (realpath(path, resolved_path) == nullptr) { if (realpath(path, resolvedPath) == nullptr) {
return false; return false;
} }
struct stat buf; struct stat buf;
return stat(resolved_path, &buf) == 0 && S_ISDIR(buf.st_mode); return stat(resolvedPath, &buf) == 0 && S_ISDIR(buf.st_mode);
} }
std::string trim(std::string &s) std::string trim(std::string &s)