[Nagiosplug-checkins] CVS: nagiosplug/plugins urlize.c,1.2,1.3

Karl DeBisschop kdebisschop at users.sourceforge.net
Wed Sep 25 19:18:03 CEST 2002


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

Modified Files:
	urlize.c 
Log Message:
use ssprintf instead of sprintf

Index: urlize.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/urlize.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** urlize.c	19 Jun 2002 05:11:52 -0000	1.2
--- urlize.c	26 Sep 2002 02:17:45 -0000	1.3
***************
*** 49,53 ****
  {
  	int i = 0, found = 0, result = STATE_UNKNOWN;
! 	char command_line[MAX_INPUT_BUFFER] = "";
  	char input_buffer[MAX_INPUT_BUFFER];
  
--- 49,53 ----
  {
  	int i = 0, found = 0, result = STATE_UNKNOWN;
! 	char *cmd = NULL;
  	char input_buffer[MAX_INPUT_BUFFER];
  
***************
*** 72,83 ****
  	}
  
! 	sprintf (command_line, "%s", argv[2]);
  	for (i = 3; i < argc; i++) {
! 		sprintf (command_line, "%s %s", command_line, argv[i]);
  	}
  
! 	child_process = spopen (command_line);
  	if (child_process == NULL) {
! 		printf ("Could not open pipe: %s\n", command_line);
  		exit (STATE_UNKNOWN);
  	}
--- 72,83 ----
  	}
  
! 	cmd = ssprintf (cmd, "%s", argv[2]);
  	for (i = 3; i < argc; i++) {
! 		cmd = ssprintf (cmd, "%s %s", cmd, argv[i]);
  	}
  
! 	child_process = spopen (cmd);
  	if (child_process == NULL) {
! 		printf ("Could not open pipe: %s\n", cmd);
  		exit (STATE_UNKNOWN);
  	}
***************
*** 85,89 ****
  	child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
  	if (child_stderr == NULL) {
! 		printf ("Could not open stderr for %s\n", command_line);
  	}
  
--- 85,89 ----
  	child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
  	if (child_stderr == NULL) {
! 		printf ("Could not open stderr for %s\n", cmd);
  	}
  
***************
*** 102,106 ****
  	if (!found) {
  		printf ("%s problem - No data recieved from host\nCMD: %s\n", argv[0],
! 						command_line);
  		exit (STATE_UNKNOWN);
  	}
--- 102,106 ----
  	if (!found) {
  		printf ("%s problem - No data recieved from host\nCMD: %s\n", argv[0],
! 						cmd);
  		exit (STATE_UNKNOWN);
  	}





More information about the Commits mailing list