mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
parser: fix warning in net_find_af_name
The fix to prevent the compiler from SEGV'ing when dumping network rules in commit 2888 introduced the following compiler warning: network.c: In function ‘const char* net_find_af_name(unsigned int)’: network.c:331:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < sizeof(network_mappings) / sizeof(*network_mappings); i++) { The problem is that the counter i is an int, but sizeof returns size_t which is unsigned. The following patch fixes the issue by converting the type of i to size_t. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
a11a39dd28
commit
1b1a0d448d
1 changed files with 1 additions and 1 deletions
|
@ -323,7 +323,7 @@ struct aa_network_entry *network_entry(const char *family, const char *type,
|
|||
|
||||
const char *net_find_af_name(unsigned int af)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
if (af < 0 || af > get_af_max())
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue