/* check the file exits actually */
exist = open(path, O_RDONLY);
if (exist < 0) {
- media_content_sec_debug("path [%s]", path);
- media_content_stderror("open file fail");
- if (errno == EACCES || errno == EPERM)
+ if (errno == EACCES || errno == EPERM) {
+ media_content_stderror("open file fail");
+ media_content_sec_debug("path [%s]", path);
return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
- else
+ } else {
+ media_content_stderror("open file fail");
+ media_content_sec_debug("path [%s]", path);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
}
close(exist);
memset(buf, 0, sizeof(buf));
if (!SAFE_STRLCPY(buf, input_path, sizeof(buf)))
- media_content_sec_debug("Truncation occurred[%d]", strlen(input_path));
+ media_content_sec_debug("Truncation occurred[%zu]", strlen(input_path));
while ((pos = strstr(buf, "//")) != NULL) {
memset(tmp, 0, sizeof(tmp));
memset(buf, 0, sizeof(buf));
if (!SAFE_STRLCPY(buf, tmp, sizeof(buf)))
- media_content_sec_debug("Truncation occurred[%d]", strlen(tmp));
+ media_content_sec_debug("Truncation occurred[%zu]", strlen(tmp));
}
if (g_str_has_suffix(buf, "/"))
#endif
dp = opendir(path);
if (dp == NULL) {
- media_content_sec_error("path [%s]", path);
- media_content_stderror("open dir fail");
-
- if (errno == EACCES || errno == EPERM)
+ if (errno == EACCES || errno == EPERM) {
+ media_content_stderror("open dir fail");
+ media_content_sec_error("path [%s]", path);
return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
- else
+ } else {
+ media_content_stderror("open dir fail");
+ media_content_sec_error("path [%s]", path);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
}
closedir(dp);