[Nagiosplug-checkins] CVS: nagiosplug/plugins check_ping.c,1.25,1.26

Ton Voon tonvoon at users.sourceforge.net
Mon Feb 9 00:32:02 CET 2004


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10503

Modified Files:
	check_ping.c 
Log Message:
Fix for check_ping old-style argument handling (Patrick McCormick - 892211)


Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** check_ping.c	12 Sep 2003 11:38:32 -0000	1.25
--- check_ping.c	9 Feb 2004 08:27:54 -0000	1.26
***************
*** 75,79 ****
  	textdomain (PACKAGE);
  
! 	addresses = malloc ((size_t)max_addr);
  
  	if (process_arguments (argc, argv) == ERROR)
--- 75,80 ----
  	textdomain (PACKAGE);
  
! 	addresses = malloc (sizeof(char*) * max_addr);
! 	addresses[0] = NULL;
  
  	if (process_arguments (argc, argv) == ERROR)
***************
*** 229,233 ****
  				if (n_addresses > max_addr) {
  					max_addr *= 2;
! 					addresses = realloc (addresses, (size_t)max_addr);
  					if (addresses == NULL)
  						die (STATE_UNKNOWN, _("Could not realloc() addresses\n"));
--- 230,234 ----
  				if (n_addresses > max_addr) {
  					max_addr *= 2;
! 					addresses = realloc (addresses, sizeof(char*) * max_addr);
  					if (addresses == NULL)
  						die (STATE_UNKNOWN, _("Could not realloc() addresses\n"));
***************
*** 273,276 ****
--- 274,278 ----
  		} else {
  			addresses[0] = argv[c++];
+ 			n_addresses++;
  			if (c == argc)
  				return validate_arguments ();





More information about the Commits mailing list