Changeset 15502 for trunk/psLib/src/sys/psString.c
- Timestamp:
- Nov 7, 2007, 6:22:23 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psString.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psString.c
r15498 r15502 13 13 * @author David Robbins, MHPCC 14 14 * 15 * @version $Revision: 1.5 8$ $Name: not supported by cvs2svn $16 * @date $Date: 2007-11-08 0 3:12:24$15 * @version $Revision: 1.59 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2007-11-08 04:22:23 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 36 36 static void stringFree(psString string) 37 37 { 38 // this function is only ne ssicary so psMemCheckString has a function38 // this function is only necessary so psMemCheckString has a function 39 39 // pointer address to test against 40 40 } … … 46 46 size_t nChar) 47 47 { 48 if (nChar < 1) {49 return NULL;50 }51 52 48 psString string = p_psAlloc(file, lineno, func, nChar + 1); 53 49 psMemSetDeallocator(string, (psFreeFunc)stringFree); … … 75 71 76 72 // Output string 77 psString output = p_psStringAlloc(file, lineno, func, strlen(string) + 1);73 psString output = p_psStringAlloc(file, lineno, func, strlen(string)); 78 74 79 75 // Copy input string to memory just allocated … … 102 98 } 103 99 104 nChar = PS_MIN(nChar, strlen(string));105 106 100 // Copy input string to memory allocated up to nChar characters 107 psString output = p_psStringAlloc(file, lineno, func, nChar + 1);101 psString output = p_psStringAlloc(file, lineno, func, nChar); 108 102 output = strncpy(output, string, nChar); 109 103
Note:
See TracChangeset
for help on using the changeset viewer.
