Changeset 6132
- Timestamp:
- Jan 21, 2006, 1:44:37 PM (20 years ago)
- Location:
- branches/eam_rel9_b1/psLib/src
- Files:
-
- 3 edited
-
sys/psString.c (modified) (3 diffs)
-
sys/psString.h (modified) (3 diffs)
-
types/psMetadata.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_b1/psLib/src/sys/psString.c
r6025 r6132 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.21.6. 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-01- 17 09:23:21$14 * @version $Revision: 1.21.6.2 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-01-21 23:44:37 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 // Copy input string to memory just allocated 33 33 // Return the copy 34 return strcpy(psAlloc(strlen(string) + 1), string); 34 // Pass through NULL values 35 return string ? strcpy(psAlloc(strlen(string) + 1), string) : NULL; 35 36 } 36 37 … … 50 51 // Copy input string to memory allocated up to nChar characters 51 52 // Return the copy 52 returnValue = strncpy(psAlloc((size_t) nChar + 1), string, (size_t) nChar); 53 // Pass through NULL values 54 returnValue = 55 string ? strncpy(psAlloc((size_t) nChar + 1), string, (size_t) nChar) 56 : NULL; 53 57 54 58 // Ensure the last byte is NULL character -
branches/eam_rel9_b1/psLib/src/sys/psString.h
r6025 r6132 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1.16.18. 1$ $Name: not supported by cvs2svn $16 * @date $Date: 2006-01- 17 09:23:21$15 * @version $Revision: 1.16.18.2 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-01-21 23:44:37 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 36 36 /** Copies the input string 37 37 * 38 * This function shall allocate memory to the length of the input string 39 * plus one and copy the input string to the newly allocated memory. 38 * This function shall allocate memory to the length of the input string plus 39 * one and copy the input string to the newly allocated memory. If 'string' 40 * is 'NULL' then 'NULL' is returned. 40 41 * 41 42 * @return psString: Copy of input string … … 54 55 * string will be a substring of the input string. If the input string 55 56 * is smaller than nChar bytes then the remaining bytes allocated will 56 * be set to NULL. 57 * be set to NULL. If 'string' is 'NULL' then 'NULL' is returned. 57 58 * 58 59 * @return psString: Copy of input string -
branches/eam_rel9_b1/psLib/src/types/psMetadata.c
r6026 r6132 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.92.6. 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-01- 17 09:24:23$14 * @version $Revision: 1.92.6.3 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-01-21 23:44:37 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 244 244 case PS_DATA_STRING: 245 245 // Perform copy of input strings 246 metadataItem->data.V = psStringNCopy(va_arg(argPtr, char *), MAX_STRING_LENGTH); 246 { 247 char *string = va_arg(argPtr, char *); 248 metadataItem->data.V = 249 string ? psStringNCopy(string, MAX_STRING_LENGTH) 250 : NULL; 251 } 247 252 break; 248 253 case PS_DATA_ARRAY: // psArray
Note:
See TracChangeset
for help on using the changeset viewer.
