summaryrefslogtreecommitdiffstats
path: root/plugins/check_cluster.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2021-12-02 15:42:05 (GMT)
committerGitHub <noreply@github.com>2021-12-02 15:42:05 (GMT)
commit911e44045d7291f5ede22739fd176ef55dd3de4a (patch)
treecf36b95a4a964b03d6ecf75770ced2cb3a2ac3a9 /plugins/check_cluster.c
parent8294af907bd8482a86df749f562b7ec09e3faeed (diff)
parented7cdf82a42f16532801ea4f118870ce9a130fcf (diff)
downloadmonitoring-plugins-911e44045d7291f5ede22739fd176ef55dd3de4a.tar.gz
Merge branch 'master' into fix/shellcheckrefs/pull/1459/head
Diffstat (limited to 'plugins/check_cluster.c')
-rw-r--r--plugins/check_cluster.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/check_cluster.c b/plugins/check_cluster.c
index b86e501..e1ede9f 100644
--- a/plugins/check_cluster.c
+++ b/plugins/check_cluster.c
@@ -143,6 +143,7 @@ int main(int argc, char **argv){
143 143
144int process_arguments(int argc, char **argv){ 144int process_arguments(int argc, char **argv){
145 int c; 145 int c;
146 char *ptr;
146 int option=0; 147 int option=0;
147 static struct option longopts[]={ 148 static struct option longopts[]={
148 {"data", required_argument,0,'d'}, 149 {"data", required_argument,0,'d'},
@@ -188,6 +189,15 @@ int process_arguments(int argc, char **argv){
188 189
189 case 'd': /* data values */ 190 case 'd': /* data values */
190 data_vals=(char *)strdup(optarg); 191 data_vals=(char *)strdup(optarg);
192 /* validate data */
193 for (ptr=data_vals;ptr!=NULL;ptr+=2){
194 if (ptr[0]<'0' || ptr[0]>'3')
195 return ERROR;
196 if (ptr[1]=='\0')
197 break;
198 if (ptr[1]!=',')
199 return ERROR;
200 }
191 break; 201 break;
192 202
193 case 'l': /* text label */ 203 case 'l': /* text label */