Changeset 7901 for trunk/psLib/src/sys/psString.c
- Timestamp:
- Jul 13, 2006, 4:26:25 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psString.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psString.c
r7879 r7901 13 13 * @author David Robbins, MHPCC 14 14 * 15 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $16 * @date $Date: 2006-07-1 2 21:17:51$15 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-07-14 02:26:25 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 30 30 #include "psErrorText.h" 31 31 32 static void stringFree(psString string) 33 { 34 // There is non dynamic allocated item 35 } 36 37 psString psStringAlloc(long nChar) 38 { 39 if (nChar < 1) { 40 return NULL; 41 } 42 psString string = psAlloc(nChar + 1); 43 psMemSetDeallocator(string, (psFreeFunc)stringFree); 44 return string; 45 } 46 47 bool psMemCheckString(psPtr ptr) 48 { 49 if (!is_psType(ptr)) { 50 return false; 51 } 52 return ( psMemGetDeallocator(ptr) == (psFreeFunc)stringFree ); 53 } 54 32 55 psString psStringCopy(const char *string) 33 56 { … … 231 254 return input; 232 255 } 256 if (!psMemCheckString(input)) { 257 return input; 258 } 259 233 260 234 261 // replace == NULL is valid: it just means that we strip out the key
Note:
See TracChangeset
for help on using the changeset viewer.
