Module: check_mk
Branch: master
Commit: b68d4b80e8d054f32dfc37439b218bcf84c15f81
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b68d4b80e8d054…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Dec 1 13:29:43 2017 +0100
Make cppcheck happy again.
Change-Id: I28fe7ec2f8bec787d233dd557b5bf92456d676df
---
active_checks/check_mkevents.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/active_checks/check_mkevents.cc b/active_checks/check_mkevents.cc
index fba3c4f..2b5aa96 100644
--- a/active_checks/check_mkevents.cc
+++ b/active_checks/check_mkevents.cc
@@ -123,11 +123,11 @@ int main(int argc, char **argv) {
int argc_count = argc;
for (int i = 1; i < argc; i++) {
- if (strcmp("-H", argv[i]) == 0 && i < argc + 1) {
+ if (i < argc + 1 && strcmp("-H", argv[i]) == 0) {
remote_host = argv[i + 1];
i++;
argc_count -= 2;
- } else if (strcmp("-s", argv[i]) == 0 && i < argc + 1) {
+ } else if (i < argc + 1 && strcmp("-s", argv[i]) == 0) {
unixsocket_path = argv[i + 1];
i++;
argc_count -= 2;