mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 22:35:35 +00:00
libapparmor: fix warnings in private.c
private.c: In function ‘_aa_is_blacklisted’: private.c:140:35: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 140 | found - name + suffix->len == name_len ) { | ^~ private.c: In function ‘readdirfd’: private.c:352:16: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘ssize_t’ {aka ‘long int’} [-Wsign-compare] 352 | for (i = 0; i < n; ) { | ^ private.c:378:17: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘ssize_t’ {aka ‘long int’} [-Wsign-compare] 378 | for (i = 0; i < n; i++) | ^ MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/561 Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Steve Beattie <sbeattie@ubuntu.com>
This commit is contained in:
@@ -126,7 +126,7 @@ bool atomic_dec_and_test(unsigned int *v)
|
|||||||
|
|
||||||
int _aa_is_blacklisted(const char *name)
|
int _aa_is_blacklisted(const char *name)
|
||||||
{
|
{
|
||||||
size_t name_len = strlen(name);
|
ssize_t name_len = strlen(name);
|
||||||
struct ignored_suffix_t *suffix;
|
struct ignored_suffix_t *suffix;
|
||||||
|
|
||||||
/* skip dot files and files with no name */
|
/* skip dot files and files with no name */
|
||||||
@@ -315,8 +315,7 @@ static ssize_t readdirfd(int dirfd, struct dirent ***out,
|
|||||||
int (*dircmp)(const struct dirent **, const struct dirent **))
|
int (*dircmp)(const struct dirent **, const struct dirent **))
|
||||||
{
|
{
|
||||||
struct dirent **dents = NULL, *dent;
|
struct dirent **dents = NULL, *dent;
|
||||||
ssize_t n = 0;
|
ssize_t n = 0, i;
|
||||||
size_t i;
|
|
||||||
int save;
|
int save;
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user