diff options
author | Eric Stanley <estanley@nagios.com> | 2012-04-06 10:22:05 -0500 |
---|---|---|
committer | Eric Stanley <estanley@nagios.com> | 2012-04-06 10:22:05 -0500 |
commit | 019c9263708d48f2140eeaafb6577ce9ad013c5e (patch) | |
tree | afba02d4e75257137f59be7736f96b0fd45f9928 /plugins/check_snmp.c | |
parent | 9cdd9a149c1c0213802d15cc204d60b3199a9653 (diff) | |
parent | d796c16327e6e315dd528f17e8bd597c5f506730 (diff) | |
download | monitoring-plugins-019c9263708d48f2140eeaafb6577ce9ad013c5e.tar.gz |
Merge branch 'master' of ssh://nagiosplug.git.sourceforge.net/gitroot/nagiosplug/nagiosplug
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r-- | plugins/check_snmp.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index d79da8cf..4cd38051 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -740,7 +740,7 @@ process_arguments (int argc, char **argv) labels[nlabels - 1] = optarg; ptr = thisarg (optarg); labels[nlabels - 1] = ptr; - if (strstr (ptr, "'") == ptr) + if (ptr[0] == '\'') labels[nlabels - 1] = ptr + 1; while (ptr && (ptr = nextarg (ptr))) { if (nlabels >= labels_size) { @@ -749,9 +749,9 @@ process_arguments (int argc, char **argv) if (labels == NULL) die (STATE_UNKNOWN, _("Could not reallocate labels\n")); } - labels++; + nlabels++; ptr = thisarg (ptr); - if (strstr (ptr, "'") == ptr) + if (ptr[0] == '\'') labels[nlabels - 1] = ptr + 1; else labels[nlabels - 1] = ptr; @@ -769,7 +769,7 @@ process_arguments (int argc, char **argv) unitv[nunits - 1] = optarg; ptr = thisarg (optarg); unitv[nunits - 1] = ptr; - if (strstr (ptr, "'") == ptr) + if (ptr[0] == '\'') unitv[nunits - 1] = ptr + 1; while (ptr && (ptr = nextarg (ptr))) { if (nunits >= unitv_size) { @@ -780,7 +780,7 @@ process_arguments (int argc, char **argv) } nunits++; ptr = thisarg (ptr); - if (strstr (ptr, "'") == ptr) + if (ptr[0] == '\'') unitv[nunits - 1] = ptr + 1; else unitv[nunits - 1] = ptr; @@ -935,7 +935,7 @@ char * thisarg (char *str) { str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ - if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */ + if (str[0] == '\'') { /* handle SIMPLE quoted strings */ if (strlen (str) == 1 || !strstr (str + 1, "'")) die (STATE_UNKNOWN, _("Unbalanced quotes\n")); } @@ -951,7 +951,7 @@ thisarg (char *str) char * nextarg (char *str) { - if (strstr (str, "'") == str) { + if (str[0] == '\'') { str[0] = 0; if (strlen (str) > 1) { str = strstr (str + 1, "'"); @@ -961,7 +961,7 @@ nextarg (char *str) return NULL; } } - if (strstr (str, ",") == str) { + if (str[0] == ',') { str[0] = 0; if (strlen (str) > 1) { return (++str); @@ -1072,8 +1072,8 @@ print_help (void) printf ("\n"); printf ("%s\n", _("Notes:")); - printf (" %s\n", _("- Multiple OIDs may be indicated by a comma or space-delimited list (lists with")); - printf (" %s %i %s\n", _("internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs.")); + printf (" %s\n", _("- Multiple OIDs (and labels) may be indicated by a comma or space-delimited ")); + printf (" %s %i %s\n", _("list (lists with internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs.")); printf(" -%s", UT_THRESHOLDS_NOTES); |