]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
cmdmon: change name fields to unsigned type
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 17 Aug 2020 14:27:54 +0000 (16:27 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 17 Aug 2020 14:28:36 +0000 (16:28 +0200)
candm.h
client.c

diff --git a/candm.h b/candm.h
index a786ae74f0c4d2c91f2753e478ea2176d1dcd726..34354e3e0bb16754aaa541a29ee1684d8aae6810 100644 (file)
--- 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;
 
index 5be40689a50ce3883df033ad399a45ad8b5383cc..cf40ebfd71b85c8ebafb57af4af2d807c1885113 100644 (file)
--- 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 */