diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-29 10:09:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-29 10:09:00 (GMT) |
commit | 77e38ac1c025b8431d1834a2c1059f9677c78ab1 (patch) | |
tree | aa8dc016303530e56155826f355cb7e3c3a4ee94 /plugins/check_ups.c | |
parent | 2eea6bb2a04bbfb169bac5f0f7c319f998e8ab87 (diff) | |
parent | eead88edda047843b911afd7b63e7decfee306ce (diff) | |
download | monitoring-plugins-77e38ac1c025b8431d1834a2c1059f9677c78ab1.tar.gz |
Merge pull request #1953 from RincewindsHat/compiler_warnings-sign-compare
Fixes for -Wsign-compare
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 d1ded62..bb91c4a 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 | } |