aboutsummaryrefslogtreecommitdiff
path: root/src/Redirect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Redirect.c')
-rw-r--r--src/Redirect.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Redirect.c b/src/Redirect.c
index 5502e5c..ced0287 100644
--- a/src/Redirect.c
+++ b/src/Redirect.c
@@ -8,10 +8,6 @@
@version $Id$
@@*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "cctk.h"
#ifdef CCTK_MPI
@@ -114,7 +110,8 @@ int HTTP_SetupRedirect(int port,
#ifdef HTTPD_DEBUG
printf("alladdr is %s\n", alladdr);
#endif
- strcpy(httpmaster,alladdr); /* the 0th element is the master hostname */
+ strncpy(httpmaster,alladdr, sizeof(httpmaster)); /* the 0th element is the master hostname */
+ httpmaster[sizeof(httpmaster) - 1] = '\0';
/* so compare my addr to the list sequentially */
for(i=0;i<nprocs;i++)