[Nagiosplug-checkins] CVS: nagiosplug/plugins check_snmp.c,1.35,1.36
Karl DeBisschop
kdebisschop at users.sourceforge.net
Tue Nov 11 22:06:10 CET 2003
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv32462
Modified Files:
check_snmp.c
Log Message:
clean up compiler warnings
Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** check_snmp.c 22 Aug 2003 06:22:38 -0000 1.35
--- check_snmp.c 12 Nov 2003 06:05:38 -0000 1.36
***************
*** 454,462 ****
/* Test parameters */
case 'c': /* critical time threshold */
! if (strspn (optarg, "0123456789:,") < strlen (optarg)) {
! printf (_("Invalid critical threshold: %s\n"), optarg);
! print_usage ();
! exit (STATE_UNKNOWN);
! }
for (ptr = optarg; ptr && jj < MAX_OIDS; jj++) {
if (lu_getll (&lower_crit_lim[jj], ptr) == 1)
--- 454,459 ----
/* Test parameters */
case 'c': /* critical time threshold */
! if (strspn (optarg, "0123456789:,") < strlen (optarg))
! usage2 (_("Invalid critical threshold: %s\n"), optarg);
for (ptr = optarg; ptr && jj < MAX_OIDS; jj++) {
if (lu_getll (&lower_crit_lim[jj], ptr) == 1)
***************
*** 468,476 ****
break;
case 'w': /* warning time threshold */
! if (strspn (optarg, "0123456789:,") < strlen (optarg)) {
! printf (_("Invalid warning threshold: %s\n"), optarg);
! print_usage ();
! exit (STATE_UNKNOWN);
! }
for (ptr = optarg; ptr && ii < MAX_OIDS; ii++) {
if (lu_getll (&lower_warn_lim[ii], ptr) == 1)
--- 465,470 ----
break;
case 'w': /* warning time threshold */
! if (strspn (optarg, "0123456789:,") < strlen (optarg))
! usage2 (_("Invalid warning threshold: %s\n"), optarg);
for (ptr = optarg; ptr && ii < MAX_OIDS; ii++) {
if (lu_getll (&lower_warn_lim[ii], ptr) == 1)
***************
*** 546,553 ****
labels[nlabels - 1] = optarg;
ptr = thisarg (optarg);
if (strstr (ptr, "'") == ptr)
labels[nlabels - 1] = ptr + 1;
- else
- labels[nlabels - 1] = ptr;
while (ptr && (ptr = nextarg (ptr))) {
if (nlabels >= labels_size) {
--- 540,546 ----
labels[nlabels - 1] = optarg;
ptr = thisarg (optarg);
+ labels[nlabels - 1] = ptr;
if (strstr (ptr, "'") == ptr)
labels[nlabels - 1] = ptr + 1;
while (ptr && (ptr = nextarg (ptr))) {
if (nlabels >= labels_size) {
***************
*** 577,584 ****
unitv[nunits - 1] = optarg;
ptr = thisarg (optarg);
if (strstr (ptr, "'") == ptr)
unitv[nunits - 1] = ptr + 1;
- else
- unitv[nunits - 1] = ptr;
while (ptr && (ptr = nextarg (ptr))) {
if (nunits >= unitv_size) {
--- 570,576 ----
unitv[nunits - 1] = optarg;
ptr = thisarg (optarg);
+ unitv[nunits - 1] = ptr;
if (strstr (ptr, "'") == ptr)
unitv[nunits - 1] = ptr + 1;
while (ptr && (ptr = nextarg (ptr))) {
if (nunits >= unitv_size) {
***************
*** 833,853 ****
{
if (strstr (str, "'") == str) {
if (strlen (str) > 1) {
str = strstr (str + 1, "'");
- str[0] = 0;
return (++str);
}
else {
- str[0] = 0;
return NULL;
}
}
if (strstr (str, ",") == str) {
if (strlen (str) > 1) {
- str[0] = 0;
return (++str);
}
else {
- str[0] = 0;
return NULL;
}
--- 825,843 ----
{
if (strstr (str, "'") == str) {
+ str[0] = 0;
if (strlen (str) > 1) {
str = strstr (str + 1, "'");
return (++str);
}
else {
return NULL;
}
}
if (strstr (str, ",") == str) {
+ str[0] = 0;
if (strlen (str) > 1) {
return (++str);
}
else {
return NULL;
}
More information about the Commits
mailing list