summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-03-08 16:10:45 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2023-03-08 16:10:45 +0100
commitfc927e98db73850e760f490117ed36f2de20270c (patch)
treefe341fa478450a1d16170ead116e57ddff475832
parent2902381c5de01f69d61569b0c8dae6a92e2b9843 (diff)
downloadmonitoring-plugins-fc927e98db73850e760f490117ed36f2de20270c.tar.gz
fixed a wrong compare and a wrong size in strncat
-rw-r--r--plugins/check_curl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 512fb88a..cc17ef58 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -422,8 +422,8 @@ lookup_host (const char *host, char *buf, size_t buflen)
422 // Append all IPs to buf as a comma-separated string 422 // Append all IPs to buf as a comma-separated string
423 addrstr_len = strlen(addrstr); 423 addrstr_len = strlen(addrstr);
424 if (buflen_remaining > addrstr_len + 1) { 424 if (buflen_remaining > addrstr_len + 1) {
425 if (buf[0] != NULL) { 425 if (buf[0] != '\0') {
426 strncat(buf, ",", 1); 426 strncat(buf, ",", buflen_remaining);
427 buflen_remaining -= 1; 427 buflen_remaining -= 1;
428 } 428 }
429 strncat(buf, addrstr, buflen_remaining); 429 strncat(buf, addrstr, buflen_remaining);