summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2023-12-30 19:39:31 (GMT)
committerGitHub <noreply@github.com>2023-12-30 19:39:31 (GMT)
commit7dfddfbc88b1d78b9824a68feca19df87a3eb504 (patch)
tree6a79e50b310b3fa6f1a74797a0c6b9516046e552
parentbad156676894a2755c8b76519a11cdd2037e5cd6 (diff)
parent8fe3fc78299dbd5fc3612853a502a99fbaf35451 (diff)
downloadmonitoring-plugins-7dfddfbc88b1d78b9824a68feca19df87a3eb504.tar.gz
Merge pull request #1980 from RincewindsHat/compiler_warning_part_7HEADmaster
Compiler warning part 7
-rw-r--r--plugins-root/check_dhcp.c2
-rw-r--r--plugins/check_http.c5
-rw-r--r--plugins/check_snmp.c4
-rw-r--r--plugins/popen.c2
-rw-r--r--plugins/runcmd.c2
5 files changed, 5 insertions, 10 deletions
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
index 6b07df5..4b8f5e2 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -497,7 +497,7 @@ int send_dhcp_discover(int sock){
497 memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address)); 497 memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address));
498 opts += sizeof(requested_address); 498 opts += sizeof(requested_address);
499 } 499 }
500 discover_packet.options[opts++]=DHCP_OPTION_END; 500 discover_packet.options[opts++]= (char)DHCP_OPTION_END;
501 501
502 /* unicast fields */ 502 /* unicast fields */
503 if(unicast) 503 if(unicast)
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 110f118..425ce86 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -472,9 +472,8 @@ bool process_arguments (int argc, char **argv)
472 http_method = strdup (optarg); 472 http_method = strdup (optarg);
473 char *tmp; 473 char *tmp;
474 if ((tmp = strstr(http_method, ":")) != NULL) { 474 if ((tmp = strstr(http_method, ":")) != NULL) {
475 tmp[0] = '\0'; 475 tmp[0] = '\0'; // set the ":" in the middle to 0
476 http_method = http_method; 476 http_method_proxy = ++tmp; // this points to the second part
477 http_method_proxy = ++tmp;
478 } 477 }
479 break; 478 break;
480 case 'd': /* string or substring */ 479 case 'd': /* string or substring */
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 7ee9d0c..295aa9b 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -691,7 +691,6 @@ process_arguments (int argc, char **argv)
691{ 691{
692 char *ptr; 692 char *ptr;
693 int c = 1; 693 int c = 1;
694 int ii = 0;
695 size_t j = 0, jj = 0; 694 size_t j = 0, jj = 0;
696 695
697 int option = 0; 696 int option = 0;
@@ -848,7 +847,6 @@ process_arguments (int argc, char **argv)
848 numoids = j; 847 numoids = j;
849 if (c == 'E' || c == 'e') { 848 if (c == 'E' || c == 'e') {
850 jj++; 849 jj++;
851 ii++;
852 while (j+1 >= eval_size) { 850 while (j+1 >= eval_size) {
853 eval_size += OID_COUNT_STEP; 851 eval_size += OID_COUNT_STEP;
854 eval_method = realloc(eval_method, eval_size * sizeof(*eval_method)); 852 eval_method = realloc(eval_method, eval_size * sizeof(*eval_method));
@@ -875,7 +873,6 @@ process_arguments (int argc, char **argv)
875 memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8); 873 memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
876 } 874 }
877 eval_method[jj++] = CRIT_STRING; 875 eval_method[jj++] = CRIT_STRING;
878 ii++;
879 break; 876 break;
880 case 'R': /* regex */ 877 case 'R': /* regex */
881 cflags = REG_ICASE; 878 cflags = REG_ICASE;
@@ -896,7 +893,6 @@ process_arguments (int argc, char **argv)
896 memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8); 893 memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
897 } 894 }
898 eval_method[jj++] = CRIT_REGEX; 895 eval_method[jj++] = CRIT_REGEX;
899 ii++;
900 break; 896 break;
901 897
902 /* Format */ 898 /* Format */
diff --git a/plugins/popen.c b/plugins/popen.c
index 036bc60..54e63bc 100644
--- a/plugins/popen.c
+++ b/plugins/popen.c
@@ -105,7 +105,7 @@ spopen (const char *cmdstring)
105#endif 105#endif
106 106
107 env[0] = strdup("LC_ALL=C"); 107 env[0] = strdup("LC_ALL=C");
108 env[1] = '\0'; 108 env[1] = NULL;
109 109
110 /* if no command was passed, return with no error */ 110 /* if no command was passed, return with no error */
111 if (cmdstring == NULL) 111 if (cmdstring == NULL)
diff --git a/plugins/runcmd.c b/plugins/runcmd.c
index 32fd6b9..ed49bb9 100644
--- a/plugins/runcmd.c
+++ b/plugins/runcmd.c
@@ -115,7 +115,7 @@ np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr)
115 if(!np_pids) NP_RUNCMD_INIT; 115 if(!np_pids) NP_RUNCMD_INIT;
116 116
117 env[0] = strdup("LC_ALL=C"); 117 env[0] = strdup("LC_ALL=C");
118 env[1] = '\0'; 118 env[1] = NULL;
119 119
120 /* make copy of command string so strtok() doesn't silently modify it */ 120 /* make copy of command string so strtok() doesn't silently modify it */
121 /* (the calling program may want to access it later) */ 121 /* (the calling program may want to access it later) */