diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-11-20 01:09:51 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-11-20 01:09:51 +0000 |
commit | 95e405673ecc1af365bdb5657d22dcd542fd2348 (patch) | |
tree | 23c03d7b74ebeb26df8d86a98be5f8cc82d0f391 | |
parent | 554758a9fe2b172cf57ce0957e5ecb308f0aeeae (diff) | |
download | monitoring-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.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index ba41ebda..ba9ff0df 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c @@ -46,7 +46,7 @@ main (int argc, char **argv) { char input_buffer[MAX_INPUT_BUFFER]; char *command_line = NULL; - char *output = NULL; + char *output = ""; int result = STATE_UNKNOWN; /* Set signal handling and alarm */ @@ -94,7 +94,7 @@ main (int argc, char **argv) result = STATE_OK; } else { - strcpy (output, "Server not found in ANSWER SECTION"); + strscpy (output, "Server not found in ANSWER SECTION"); result = STATE_WARNING; } @@ -104,7 +104,7 @@ main (int argc, char **argv) } if (result != STATE_OK) { - strcpy (output, "No ANSWER SECTION found"); + strscpy (output, "No ANSWER SECTION found"); } while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) { @@ -112,7 +112,7 @@ main (int argc, char **argv) result = max_state (result, STATE_WARNING); printf ("%s", input_buffer); if (!strcmp (output, "")) - strcpy (output, 1 + index (input_buffer, ':')); + strscpy (output, 1 + index (input_buffer, ':')); } (void) fclose (child_stderr); @@ -121,7 +121,7 @@ main (int argc, char **argv) if (spclose (child_process)) { result = max_state (result, STATE_WARNING); if (!strcmp (output, "")) - strcpy (output, "nslookup returned error status"); + strscpy (output, "nslookup returned error status"); } (void) time (&end_time); |