Changeset 631 for trunk/psLib/src/sysUtils/psString.c
- Timestamp:
- May 10, 2004, 9:01:36 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sysUtils/psString.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sysUtils/psString.c
r546 r631 8 8 * @author Eric Van Alst, MHPCC 9 9 * 10 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-0 4-28 22:20:22$10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-05-10 19:01:36 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 72 72 ) 73 73 { 74 char *returnValue = NULL; 75 74 76 // Check the number of characters to copy is non-negative 75 77 if ( nChar < 0 ) { … … 82 84 // Copy input string to memory allocated up to nChar characters 83 85 // Return the copy 84 return strncpy(psAlloc((size_t)nChar + 1), str, (size_t)nChar); 86 returnValue = strncpy(psAlloc((size_t)nChar + 1), str, (size_t)nChar); 87 88 // Ensure the last byte is NULL character 89 if ( nChar > 0 ) { 90 returnValue[nChar-1] = NULL; 91 } 92 93 // Return the string pointer 94 return returnValue; 85 95 } 86 96
Note:
See TracChangeset
for help on using the changeset viewer.
