[Nagiosplug-checkins] CVS: nagiosplug/plugins check_snmp.c,1.9,1.10

Karl DeBisschop kdebisschop at users.sourceforge.net
Fri Nov 8 00:08:03 CET 2002


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory usw-pr-cvs1:/tmp/cvs-serv30235/plugins

Modified Files:
	check_snmp.c 
Log Message:
user reports NULL still getting into asprintf

Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** check_snmp.c	7 Nov 2002 14:30:08 -0000	1.9
--- check_snmp.c	8 Nov 2002 08:07:37 -0000	1.10
***************
*** 416,422 ****
  	}
  
- 	/* initialize some args */
- 	asprintf (&oid, "");
- 
  	while (1) {
  #ifdef HAVE_GETOPT_H
--- 416,419 ----
***************
*** 454,458 ****
  			for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++)
  				eval_method[++j] |= WARN_PRESENT;
! 			asprintf (&oid, "%s %s", oid, optarg);
  			break;
  		case 'E': /* PRELIMINARY - may change */
--- 451,455 ----
  			for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++)
  				eval_method[++j] |= WARN_PRESENT;
! 			asprintf (&oid, "%s %s", (oid?oid:""), optarg);
  			break;
  		case 'E': /* PRELIMINARY - may change */
***************
*** 462,466 ****
  			for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++)
  				eval_method[++j] |= CRIT_PRESENT;
! 			asprintf (&oid, "%s %s", oid, optarg);
  			break;
  		case 'c':									/* critical time threshold */
--- 459,463 ----
  			for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++)
  				eval_method[++j] |= CRIT_PRESENT;
! 			asprintf (&oid, "%s %s", (oid?oid:""), optarg);
  			break;
  		case 'c':									/* critical time threshold */
***************
*** 501,508 ****
  			for (ptr = optarg; (ptr = index (ptr, ',')); ptr++)
  				ptr[0] = ' '; /* relpace comma with space */
! 			for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++) {
  				j++; /* count OIDs */
! 			}
! 			asprintf (&oid, "%s %s", oid, optarg);
  			break;
  		case 'd':									/* delimiter */
--- 498,504 ----
  			for (ptr = optarg; (ptr = index (ptr, ',')); ptr++)
  				ptr[0] = ' '; /* relpace comma with space */
! 			for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++)
  				j++; /* count OIDs */
! 			asprintf (&oid, "%s %s", (oid?oid:""), optarg);
  			break;
  		case 'd':									/* delimiter */





More information about the Commits mailing list