@@ -104,7 +104,7 @@ static ssize_t bunzip(semanage_handle_t *sh, FILE *f, void **data)
size_t total = 0;
uint8_t* uncompress = NULL;
uint8_t* tmpalloc = NULL;
- int ret = -1;
+ ssize_t ret = -1;
buf = malloc(bufsize);
if (buf == NULL) {
@@ -172,7 +172,7 @@ int semanage_get_hll_compiler_path(semanage_handle_t *sh,
}
num_printed = snprintf(compiler, len, "%s/%s", sh->conf->compiler_directory_path, lower_lang_ext);
- if (num_printed < 0 || (int)num_printed >= (int)len) {
+ if (num_printed < 0 || (size_t)num_printed >= len) {
ERR(sh, "Error creating compiler path.");
status = -1;
goto cleanup;
@@ -85,7 +85,7 @@ int parse_skip_space(semanage_handle_t * handle, parse_info_t * info)
size_t buf_len = 0;
ssize_t len;
- int lineno = info->lineno;
+ unsigned int lineno = info->lineno;
char *buffer = NULL;
char *ptr;
@@ -271,7 +271,7 @@ int parse_fetch_string(semanage_handle_t * handle,
{
const char *start = info->ptr;
- int len = 0;
+ size_t len = 0;
char *tmp_str = NULL;
if (parse_assert_noeof(handle, info) < 0)
@@ -137,10 +137,10 @@ typedef struct semanage_file_context_node {
char *path;
char *file_type;
char *context;
- int path_len;
- int effective_len;
- int type_len;
- int context_len;
+ size_t path_len;
+ size_t effective_len;
+ size_t type_len;
+ size_t context_len;
int meta; /* position of first meta char in path, -1 if none */
struct semanage_file_context_node *next;
} semanage_file_context_node_t;
@@ -514,7 +514,7 @@ const char *semanage_final_path(enum semanage_final_defs store,
char *semanage_conf_path(void)
{
char *semanage_conf = NULL;
- int len;
+ size_t len;
struct stat sb;
len = strlen(semanage_root()) + strlen(selinux_path()) + strlen(SEMANAGE_CONF_FILE);
@@ -2895,7 +2895,7 @@ int semanage_nc_sort(semanage_handle_t * sh, const char *buf, size_t buf_len,
/* parsing bits */
const char *priority_names[] = NC_SORT_NAMES;
- const int priority_names_len[] = NC_SORT_NAMES_LEN;
+ const size_t priority_names_len[] = NC_SORT_NAMES_LEN;
size_t line_len, buf_remainder, i, offset;
const char *line_buf, *line_end;
@@ -202,9 +202,9 @@ int semanage_cmp_plist_t(const void *x, const void *y)
return strcmp((*l1)->data, (*l2)->data);
}
-int semanage_str_count(const char *data, char what)
+size_t semanage_str_count(const char *data, char what)
{
- int count = 0;
+ size_t count = 0;
if (!data)
return 0;
@@ -219,7 +219,7 @@ int semanage_str_count(const char *data, char what)
void semanage_rtrim(char *str, char trim_to)
{
- int len = 0;
+ size_t len;
if (!str)
return;
@@ -104,7 +104,7 @@ int semanage_cmp_plist_t(const void *x, const void *y);
* @param what a character
* @returns the number of times the char appears in the string
*/
-int semanage_str_count(const char *data, char what);
+size_t semanage_str_count(const char *data, char what);
/**
* @param - a string
* @param the character to trim to