summaryrefslogtreecommitdiff
path: root/libnm-core
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-09-24 11:04:35 +0200
committerThomas Haller <thaller@redhat.com>2020-09-24 11:07:36 +0200
commit3aca45ed5501a0c47b7a85f21ae3683cccb269df (patch)
tree3ecc5b10a9c3adffb65ec93da145c0568a416696 /libnm-core
parent613f74b545df1fec996e0be8165ff29906d52eb0 (diff)
downloadNetworkManager-3aca45ed5501a0c47b7a85f21ae3683cccb269df.tar.gz
shared,libnm: avoid mixing signed and unsigned integers in netmask_to_prefix()/prefix_to_netmask()
Diffstat (limited to 'libnm-core')
-rw-r--r--libnm-core/nm-utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index 58ec444c39..f084644f1a 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -1623,9 +1623,9 @@ nm_utils_ip4_netmask_to_prefix (guint32 netmask)
G_STATIC_ASSERT_EXPR (sizeof (int) == 4);
G_STATIC_ASSERT_EXPR (sizeof (netmask) == 4);
- return ( (netmask != 0)
- ? (32 - __builtin_ctz (ntohl (netmask)))
- : 0);
+ return ( (netmask != 0u)
+ ? (guint32) (32 - __builtin_ctz (ntohl (netmask)))
+ : 0u);
}
/**