@@ -472,10 +472,10 @@ static int HOME_DIR_PRED(const char *string)
/* new names */
static int USERNAME_CONTEXT_PRED(const char *string)
{
- return (int)(
- (strstr(string, TEMPLATE_USERNAME) != NULL) ||
- (strstr(string, TEMPLATE_USERID) != NULL)
- );
+ return
+ strstr(string, TEMPLATE_USERNAME) != NULL ||
+ strstr(string, TEMPLATE_USERID) != NULL
+ ;
}
/* This will never match USER if USERNAME or USERID are found. */
@@ -484,7 +484,7 @@ static int USER_CONTEXT_PRED(const char *string)
if (USERNAME_CONTEXT_PRED(string))
return 0;
- return (int)(strstr(string, TEMPLATE_USER) != NULL);
+ return strstr(string, TEMPLATE_USER) != NULL;
}
static int STR_COMPARATOR(const void *a, const void *b)
@@ -2656,7 +2656,7 @@ int semanage_fc_sort(semanage_handle_t * sh, const char *buf, size_t buf_len,
continue;
}
- temp->path = (char *)strndup(&line_buf[start], regex_len);
+ temp->path = strndup(&line_buf[start], regex_len);
if (!temp->path) {
ERR(sh, "Failure allocating memory.");
semanage_fc_node_destroy(temp);
@@ -2691,7 +2691,7 @@ int semanage_fc_sort(semanage_handle_t * sh, const char *buf, size_t buf_len,
/* Record the inode type. */
temp->file_type =
- (char *)strndup(&line_buf[i], type_len);
+ strndup(&line_buf[i], type_len);
if (!temp->file_type) {
ERR(sh, "Failure allocating memory.");
semanage_fc_node_destroy(temp);
@@ -2724,7 +2724,7 @@ int semanage_fc_sort(semanage_handle_t * sh, const char *buf, size_t buf_len,
finish = i;
context_len = finish - start;
- temp->context = (char *)strndup(&line_buf[start], context_len);
+ temp->context = strndup(&line_buf[start], context_len);
if (!temp->context) {
ERR(sh, "Failure allocating memory.");
semanage_fc_node_destroy(temp);
@@ -2963,7 +2963,7 @@ int semanage_nc_sort(semanage_handle_t * sh, const char *buf, size_t buf_len,
}
node->rule =
- (char *)strndup(line_buf + offset, line_len - offset);
+ strndup(line_buf + offset, line_len - offset);
node->rule_len = line_len - offset;
node->next = NULL;