From 506821df3e3bc79a2ed160fee59c5661295c3b5a Mon Sep 17 00:00:00 2001 From: Gabriel Majeri Date: Sun, 24 Sep 2017 14:59:27 +0300 Subject: [PATCH] Cast port to 16-bit integer --- src/dp-message.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dp-message.c b/src/dp-message.c index 6fe20b4..235bc7f 100644 --- a/src/dp-message.c +++ b/src/dp-message.c @@ -35,7 +35,7 @@ format_ipv4_addr_helper(char *buf, size_t size, const char *dp_type, format(buf, size, off, dp_type, "%hhu.%hhu.%hhu.%hhu", ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); if (port > 0) - format(buf, size, off, dp_type, ":%hu", port); + format(buf, size, off, dp_type, ":%hu", (uint16_t)port); return off; } @@ -102,7 +102,7 @@ format_ipv6_addr_helper(char *buf, size_t size, const char *dp_type, format(buf, size, off, "dp_type", "]"); if (port >= 0) - format(buf, size, off, "Ipv6", ":%hu", port); + format(buf, size, off, "Ipv6", ":%hu", (uint16_t)port); return off; } -- 2.11.0