Index: trunk/psLib/src/sys/psTrace.c
===================================================================
--- trunk/psLib/src/sys/psTrace.c	(revision 8575)
+++ trunk/psLib/src/sys/psTrace.c	(revision 8577)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.75 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-24 23:52:00 $
+ *  @version $Revision: 1.76 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-08-25 00:03:35 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -56,4 +56,5 @@
 #define MAX_HEADER_LENGTH 256
 #define MAX_TRACE_LENGTH 1024
+#define MAX_COMPONENT_LENGTH 1024
 
 
@@ -167,6 +168,5 @@
 
     psS32 i = 0;                        // Loop index variable.
-    char name[strlen(addNodeName) + 1]; // buffer for writeable copy.
-    char *pname = name;
+    char name[MAX_COMPONENT_LENGTH]; // buffer for writeable copy.
     char *firstComponent = NULL;        // first component of name
     p_psComponent* currentNode = cRoot;
@@ -193,6 +193,6 @@
     }
 
-    strcpy(name, addNodeName);
-    pname = name+1;
+    strncpy(name, addNodeName, MAX_COMPONENT_LENGTH);
+    char *pname = name+1;               // Take off the period
     // Iterate through the components of addNodeName.  Strip off the first
     // component of the name, find that in the root tree, or add it if it
@@ -643,17 +643,17 @@
     PS_ASSERT_PTR_NON_NULL(format, );
 
+    // XXX file & lineo are currently unused
+
+    // Append the function name to the facility
+    size_t facilLength = strlen(facil); // Length of facility name
+    char fullFacil[MAX_HEADER_LENGTH]; // Full facility name is the facility + the function name
+    strncpy(&fullFacil[0], facil, MAX_HEADER_LENGTH);
+    if (facilLength + 1 < MAX_HEADER_LENGTH) {
+        fullFacil[facilLength] = '.';
+        strncpy(&fullFacil[facilLength + 1], func, MAX_HEADER_LENGTH - facilLength - 1);
+    }
+
     va_list ap;
     va_start(ap, format);
-
-    // XXX file & lineo are currently unused
-
-    // Append the function name to the facility
-    size_t facilLength = strlen(facil); // Length of facility name
-    //size_t funcLength = strlen(func);   // Length of function name
-    char fullFacil[MAX_HEADER_LENGTH]; // Full facility name is the facility + the function name
-    strncpy(&fullFacil[0], facil, MAX_HEADER_LENGTH);
-    fullFacil[facilLength] = '.';
-    strncpy(&fullFacil[facilLength + 1], func, MAX_HEADER_LENGTH - facilLength - 1);
-
     psTraceV(fullFacil, level, format, ap);
     va_end(ap);
