Changeset 4409 for trunk/psLib/src/sysUtils/psString.c
- Timestamp:
- Jun 28, 2005, 10:17:52 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sysUtils/psString.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sysUtils/psString.c
r3997 r4409 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 5-20 01:41:17$14 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-28 20:17:52 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psSysUtilsErrors.h" 27 27 28 char *psStringCopy(const char *str)28 psString psStringCopy(const char *string) 29 29 { 30 30 // Allocate memory using psAlloc function 31 31 // Copy input string to memory just allocated 32 32 // Return the copy 33 return strcpy(psAlloc(strlen(str ) + 1), str);33 return strcpy(psAlloc(strlen(string) + 1), string); 34 34 } 35 35 36 char *psStringNCopy(const char *str, psS32nChar)36 psString psStringNCopy(const char *string, int nChar) 37 37 { 38 38 char *returnValue = NULL; … … 49 49 // Copy input string to memory allocated up to nChar characters 50 50 // Return the copy 51 returnValue = strncpy(psAlloc((size_t) nChar + 1), str , (size_t) nChar);51 returnValue = strncpy(psAlloc((size_t) nChar + 1), string, (size_t) nChar); 52 52 53 53 // Ensure the last byte is NULL character
Note:
See TracChangeset
for help on using the changeset viewer.
