diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2023-03-08 16:10:45 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2023-03-08 16:10:45 +0100 |
commit | fc927e98db73850e760f490117ed36f2de20270c (patch) | |
tree | fe341fa478450a1d16170ead116e57ddff475832 /plugins | |
parent | 2902381c5de01f69d61569b0c8dae6a92e2b9843 (diff) | |
download | monitoring-plugins-fc927e98db73850e760f490117ed36f2de20270c.tar.gz |
fixed a wrong compare and a wrong size in strncat
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_curl.c | 4 |
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); |