summaryrefslogtreecommitdiffstats
path: root/web/attachments/234288-check_smtp.c.patch
blob: 9a69cce71ef46cfdc654c975074305f89e37d7be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
*** check_smtp.c.orig	Wed Jun 13 12:19:37 2007
--- check_smtp.c	Wed Jun 13 12:22:30 2007
*************** process_arguments (int argc, char **argv
*** 582,603 ****
  			break;
  		case 'C':									/* commands  */
  			if (ncommands >= command_size) {
! 				commands = realloc (commands, command_size+8);
  				if (commands == NULL)
  					die (STATE_UNKNOWN,
  					     _("Could not realloc() units [%d]\n"), ncommands);
  			}
! 			commands[ncommands] = optarg;
  			ncommands++;
  			break;
  		case 'R':									/* server responses */
  			if (nresponses >= response_size) {
! 				responses = realloc (responses, response_size+8);
  				if (responses == NULL)
  					die (STATE_UNKNOWN,
  					     _("Could not realloc() units [%d]\n"), nresponses);
  			}
! 			responses[nresponses] = optarg;
  			nresponses++;
  			break;
  		case 'c':									/* critical time threshold */
--- 582,607 ----
  			break;
  		case 'C':									/* commands  */
  			if (ncommands >= command_size) {
!                                 command_size+=8;
!                                 commands = realloc (commands, sizeof(char **)*command_size);
  				if (commands == NULL)
  					die (STATE_UNKNOWN,
  					     _("Could not realloc() units [%d]\n"), ncommands);
  			}
!                         commands[ncommands] = (char *)malloc (sizeof(char)*255);
!                         strncpy (commands[ncommands], optarg, 250);
  			ncommands++;
  			break;
  		case 'R':									/* server responses */
  			if (nresponses >= response_size) {
!                                 response_size += 8;
!                                 responses = realloc (responses, sizeof(char **)*response_size);
  				if (responses == NULL)
  					die (STATE_UNKNOWN,
  					     _("Could not realloc() units [%d]\n"), nresponses);
  			}
!                         responses[nresponses] = (char *)malloc (sizeof(char)*255);
!                         strncpy (responses[nresponses], optarg, 250);
  			nresponses++;
  			break;
  		case 'c':									/* critical time threshold */