1 Commits

Author SHA1 Message Date
yangwei
2e4e4dff17 🐞fix(creat_dir): 修复计算待创建目录不包含/时长度计算错误的bug 2020-09-24 15:18:14 +08:00

View File

@@ -173,7 +173,6 @@ void *MESA_create_runtime_log_handle(const char *file_path, int level)
char handle_name[MAX_HANDLE_LOG_PATH];
char *p_path_end = rindex(file_path, '/');
char *p_name = p_path_end+1;
strcpy(handle_name, file_path);
@@ -181,10 +180,12 @@ void *MESA_create_runtime_log_handle(const char *file_path, int level)
p_name = handle_name;
//creating file_path failed, return NULL
if (create_path(file_path, p_path_end - file_path) < 0)
return NULL;
if(p_path_end != NULL && p_path_end > file_path)
{
//creating file_path failed, return NULL
if (create_path(file_path, p_path_end-file_path) < 0)
return NULL;
}
snapshot_handle_info(p_name, file_path, level);
zlog_reload(NULL);
zc = zlog_get_category(p_name);