summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2002-11-20 01:09:51 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2002-11-20 01:09:51 (GMT)
commit95e405673ecc1af365bdb5657d22dcd542fd2348 (patch)
tree23c03d7b74ebeb26df8d86a98be5f8cc82d0f391
parent554758a9fe2b172cf57ce0957e5ecb308f0aeeae (diff)
downloadmonitoring-plugins-95e405673ecc1af365bdb5657d22dcd542fd2348.tar.gz
replace some strcpy with strscpy
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@216 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_dig.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index ba41ebd..ba9ff0d 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -46,7 +46,7 @@ main (int argc, char **argv)
46{ 46{
47 char input_buffer[MAX_INPUT_BUFFER]; 47 char input_buffer[MAX_INPUT_BUFFER];
48 char *command_line = NULL; 48 char *command_line = NULL;
49 char *output = NULL; 49 char *output = "";
50 int result = STATE_UNKNOWN; 50 int result = STATE_UNKNOWN;
51 51
52 /* Set signal handling and alarm */ 52 /* Set signal handling and alarm */
@@ -94,7 +94,7 @@ main (int argc, char **argv)
94 result = STATE_OK; 94 result = STATE_OK;
95 } 95 }
96 else { 96 else {
97 strcpy (output, "Server not found in ANSWER SECTION"); 97 strscpy (output, "Server not found in ANSWER SECTION");
98 result = STATE_WARNING; 98 result = STATE_WARNING;
99 } 99 }
100 100
@@ -104,7 +104,7 @@ main (int argc, char **argv)
104 } 104 }
105 105
106 if (result != STATE_OK) { 106 if (result != STATE_OK) {
107 strcpy (output, "No ANSWER SECTION found"); 107 strscpy (output, "No ANSWER SECTION found");
108 } 108 }
109 109
110 while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) { 110 while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) {
@@ -112,7 +112,7 @@ main (int argc, char **argv)
112 result = max_state (result, STATE_WARNING); 112 result = max_state (result, STATE_WARNING);
113 printf ("%s", input_buffer); 113 printf ("%s", input_buffer);
114 if (!strcmp (output, "")) 114 if (!strcmp (output, ""))
115 strcpy (output, 1 + index (input_buffer, ':')); 115 strscpy (output, 1 + index (input_buffer, ':'));
116 } 116 }
117 117
118 (void) fclose (child_stderr); 118 (void) fclose (child_stderr);
@@ -121,7 +121,7 @@ main (int argc, char **argv)
121 if (spclose (child_process)) { 121 if (spclose (child_process)) {
122 result = max_state (result, STATE_WARNING); 122 result = max_state (result, STATE_WARNING);
123 if (!strcmp (output, "")) 123 if (!strcmp (output, ""))
124 strcpy (output, "nslookup returned error status"); 124 strscpy (output, "nslookup returned error status");
125 } 125 }
126 126
127 (void) time (&end_time); 127 (void) time (&end_time);