From 2127f63961a63b042ff8061c3d0d72cb83f00e86 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 17 Aug 2020 16:27:54 +0200 Subject: [PATCH] cmdmon: change name fields to unsigned type --- candm.h | 4 ++-- client.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/candm.h b/candm.h index a786ae7..34354e3 100644 --- a/candm.h +++ b/candm.h @@ -271,7 +271,7 @@ typedef struct { typedef struct { uint32_t type; - int8_t name[256]; + uint8_t name[256]; uint32_t port; int32_t minpoll; int32_t maxpoll; @@ -732,7 +732,7 @@ typedef struct { } RPY_NTPData; typedef struct { - int8_t name[256]; + uint8_t name[256]; int32_t EOR; } RPY_NTPSourceName; diff --git a/client.c b/client.c index 5be4068..cf40ebf 100644 --- a/client.c +++ b/client.c @@ -2076,7 +2076,7 @@ get_source_name(IPAddr *ip_addr, char *buf, int size) UTI_IPHostToNetwork(ip_addr, &request.data.ntp_source_name.ip_addr); if (!request_reply(&request, &reply, RPY_NTP_SOURCE_NAME, 0) || reply.data.ntp_source_name.name[sizeof (reply.data.ntp_source_name.name) - 1] != '\0' || - snprintf(buf, size, "%s", reply.data.ntp_source_name.name) >= size) + snprintf(buf, size, "%s", (char *)reply.data.ntp_source_name.name) >= size) return 0; /* Make sure the name is printable */