Changeset 15523 for trunk/psLib/src/sys/psString.c
- Timestamp:
- Nov 8, 2007, 2:47:41 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psString.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psString.c
r15502 r15523 13 13 * @author David Robbins, MHPCC 14 14 * 15 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $16 * @date $Date: 2007-11-0 8 04:22:23$15 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2007-11-09 00:47:41 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 144 144 ssize_t tailLength = 0; // length of string to append 145 145 146 if (*dest && psMemGetRefCounter(*dest) > 1) { 147 psWarning("Appending to a string with multiple reference counts may corrupt memory!"); 148 } 149 146 150 if (*dest) { 147 151 oldLength = strlen(*dest); … … 218 222 char *oldDest; // copy of original string 219 223 224 if (*dest && psMemGetRefCounter(*dest) > 1) { 225 psWarning("Appending to a string with multiple reference counts may corrupt memory!"); 226 } 227 220 228 if (!*dest) { 221 229 // makes the string backup and concatination pointless … … 270 278 // NULL input string returns empty (not NULL) list 271 279 // NULL splitters is an error 272 psList *psStringSplit(const char *string, 273 const char *splitters, 274 bool multipleAreSignificant) 280 psList *p_psStringSplit(const char *file, 281 unsigned int lineno, 282 const char *func, 283 const char *string, 284 const char *splitters, 285 bool multipleAreSignificant) 275 286 { 276 287 PS_ASSERT_STRING_NON_EMPTY(splitters, NULL); 277 288 278 psList *values = p sListAlloc(NULL); // The list of values to return289 psList *values = p_psListAlloc(file, lineno, func, NULL); // The list of values to return 279 290 // An input NULL string should not generate an error: it is a valid case 280 291 if (string == NULL) { … … 293 304 294 305 // Copy the current word 295 psString word = p sStringNCopy(current, next - current);306 psString word = p_psStringNCopy(file, lineno, func, current, next - current); 296 307 psListAdd(values, PS_LIST_TAIL, word); 297 308 psFree(word); … … 302 313 if (strlen(current) > 0) { 303 314 // Copy the last word 304 psString word = p sStringCopy(current);315 psString word = p_psStringCopy(file, lineno, func, current); 305 316 (void)psListAdd(values, PS_LIST_TAIL, word); 306 317 psFree(word);
Note:
See TracChangeset
for help on using the changeset viewer.
