Changeset 8577
- Timestamp:
- Aug 24, 2006, 2:03:35 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psTrace.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psTrace.c
r8575 r8577 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-08-2 4 23:52:00$11 * @version $Revision: 1.76 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-08-25 00:03:35 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 56 56 #define MAX_HEADER_LENGTH 256 57 57 #define MAX_TRACE_LENGTH 1024 58 #define MAX_COMPONENT_LENGTH 1024 58 59 59 60 … … 167 168 168 169 psS32 i = 0; // Loop index variable. 169 char name[strlen(addNodeName) + 1]; // buffer for writeable copy. 170 char *pname = name; 170 char name[MAX_COMPONENT_LENGTH]; // buffer for writeable copy. 171 171 char *firstComponent = NULL; // first component of name 172 172 p_psComponent* currentNode = cRoot; … … 193 193 } 194 194 195 str cpy(name, addNodeName);196 pname = name+1;195 strncpy(name, addNodeName, MAX_COMPONENT_LENGTH); 196 char *pname = name+1; // Take off the period 197 197 // Iterate through the components of addNodeName. Strip off the first 198 198 // component of the name, find that in the root tree, or add it if it … … 643 643 PS_ASSERT_PTR_NON_NULL(format, ); 644 644 645 // XXX file & lineo are currently unused 646 647 // Append the function name to the facility 648 size_t facilLength = strlen(facil); // Length of facility name 649 char fullFacil[MAX_HEADER_LENGTH]; // Full facility name is the facility + the function name 650 strncpy(&fullFacil[0], facil, MAX_HEADER_LENGTH); 651 if (facilLength + 1 < MAX_HEADER_LENGTH) { 652 fullFacil[facilLength] = '.'; 653 strncpy(&fullFacil[facilLength + 1], func, MAX_HEADER_LENGTH - facilLength - 1); 654 } 655 645 656 va_list ap; 646 657 va_start(ap, format); 647 648 // XXX file & lineo are currently unused649 650 // Append the function name to the facility651 size_t facilLength = strlen(facil); // Length of facility name652 //size_t funcLength = strlen(func); // Length of function name653 char fullFacil[MAX_HEADER_LENGTH]; // Full facility name is the facility + the function name654 strncpy(&fullFacil[0], facil, MAX_HEADER_LENGTH);655 fullFacil[facilLength] = '.';656 strncpy(&fullFacil[facilLength + 1], func, MAX_HEADER_LENGTH - facilLength - 1);657 658 658 psTraceV(fullFacil, level, format, ap); 659 659 va_end(ap);
Note:
See TracChangeset
for help on using the changeset viewer.
