summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobhe <tobhe@openbsd.org>2020-06-01 21:00:51 +0000
committertobhe <tobhe@openbsd.org>2020-06-01 21:00:51 +0000
commit14c62822489bc2afb05e096dd1cd9fd97c96140c (patch)
tree9ae5cdd0ce7667cf08cd7252bb2e92f597075b71
parentCheck the right thing for maximum client buffer size. (diff)
downloadwireguard-openbsd-14c62822489bc2afb05e096dd1cd9fd97c96140c.tar.xz
wireguard-openbsd-14c62822489bc2afb05e096dd1cd9fd97c96140c.zip
Fix "comparison of integers of different signs" warning.
ok patrick@
-rw-r--r--sbin/ipsecctl/pfkdump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/ipsecctl/pfkdump.c b/sbin/ipsecctl/pfkdump.c
index 12611c28828..00ddbd8bb19 100644
--- a/sbin/ipsecctl/pfkdump.c
+++ b/sbin/ipsecctl/pfkdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkdump.c,v 1.50 2020/04/23 19:57:01 tobhe Exp $ */
+/* $OpenBSD: pfkdump.c,v 1.51 2020/06/01 21:00:51 tobhe Exp $ */
/*
* Copyright (c) 2003 Markus Friedl. All rights reserved.
@@ -267,7 +267,7 @@ print_flags(uint32_t flags)
int i, comma = 0, n;
len = snprintf(fstr, sizeof(fstr), "%#x<", flags);
- if (len < 0 || len >= sizeof(fstr))
+ if (len < 0 || (size_t)len >= sizeof(fstr))
return (NULL);
for (i = 0; i < 32; i++) {
if ((flags & (1 << i)) == 0 ||
@@ -275,7 +275,7 @@ print_flags(uint32_t flags)
continue;
n = snprintf(fstr + len, sizeof(fstr) - len - 1,
comma ? ",%s" : "%s", entry->name);
- if (n < 0 || n >= sizeof(fstr) - len - 1)
+ if (n < 0 || (size_t)n >= sizeof(fstr) - len - 1)
return (NULL);
len += n;
comma = 1;