diff options
Diffstat (limited to 'src/libs/zbxsysinfo/simple/ntp.c')
-rw-r--r-- | src/libs/zbxsysinfo/simple/ntp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/zbxsysinfo/simple/ntp.c b/src/libs/zbxsysinfo/simple/ntp.c index ee98b31255e..f034c63bf57 100644 --- a/src/libs/zbxsysinfo/simple/ntp.c +++ b/src/libs/zbxsysinfo/simple/ntp.c @@ -182,7 +182,7 @@ int check_ntp(char *host, unsigned short port, int timeout, int *value_int) { zbx_sock_t s; int ret; - char *buf = NULL, packet[NTP_PACKET_MIN]; + char packet[NTP_PACKET_MIN]; ntp_data data; *value_int = 0; @@ -195,9 +195,9 @@ int check_ntp(char *host, unsigned short port, int timeout, int *value_int) if (SUCCEED == (ret = zbx_tcp_send_raw(&s, packet))) { - if (SUCCEED == (ret = zbx_tcp_recv(&s, &buf))) + if (SUCCEED == (ret = zbx_tcp_recv(&s))) { - unpack_ntp(&data, (unsigned char *)buf, (int)strlen(buf)); + unpack_ntp(&data, (unsigned char *)s.buffer, (int)strlen(s.buffer)); *value_int = (0 < data.receive ? (int)(data.receive - ZBX_JAN_1970_IN_SEC) : 0); } } |