diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2023-11-01 11:05:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 11:05:50 +0100 |
commit | 6d08e1c8c96d0327a5b819dc1fbb0d5754f3e2e5 (patch) | |
tree | 575867b1d1eef4cd20215f22f9151ebb4a02c93d /plugins/check_ups.c | |
parent | 03bde80abbda6fba2225568c3285a2ff2b5445a8 (diff) | |
parent | 76d9f25cd0dbe99657baeb6fa139a1831558adae (diff) | |
download | monitoring-plugins-6d08e1c.tar.gz |
Merge branch 'master' into fix_check_mailq
Diffstat (limited to 'plugins/check_ups.c')
-rw-r--r-- | plugins/check_ups.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/check_ups.c b/plugins/check_ups.c index d1ded620..bb91c4ad 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c | |||
@@ -402,7 +402,8 @@ get_ups_variable (const char *varname, char *buf) | |||
402 | 402 | ||
403 | /* create the command string to send to the UPS daemon */ | 403 | /* create the command string to send to the UPS daemon */ |
404 | /* Add LOGOUT to avoid read failure logs */ | 404 | /* Add LOGOUT to avoid read failure logs */ |
405 | if (snprintf (send_buffer, sizeof(send_buffer), "GET VAR %s %s\nLOGOUT\n", ups_name, varname) >= sizeof(send_buffer)) { | 405 | int res = snprintf (send_buffer, sizeof(send_buffer), "GET VAR %s %s\nLOGOUT\n", ups_name, varname); |
406 | if ( (res > 0) && ((size_t)res >= sizeof(send_buffer))) { | ||
406 | printf("%s\n", _("UPS name to long for buffer")); | 407 | printf("%s\n", _("UPS name to long for buffer")); |
407 | return ERROR; | 408 | return ERROR; |
408 | } | 409 | } |