Changeset 122 for trunk/src/helpers/stringh.c
- Timestamp:
- Dec 8, 2001, 11:14:27 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/stringh.c
r116 r122 67 67 * See stringh.c. 68 68 */ 69 70 /* 71 *@@ strhStore: 72 * stores a copy of the given string in the specified 73 * buffer. Uses strdup internally. 74 * 75 * If *ppszTarget != NULL, the previous string is freed 76 * and set to NULL. 77 * If pcszSource != NULL, a copy of it is stored in the 78 * buffer. 79 * 80 *@@added V0.9.16 (2001-12-06) [umoeller] 81 */ 82 83 VOID strhStore(PSZ *ppszTarget, 84 PCSZ pcszSource, 85 PULONG pulLength) // out: length of new string (ptr can be NULL) 86 { 87 ULONG ulLength = 0; 88 89 if (ppszTarget) 90 { 91 if (*ppszTarget) 92 free(*ppszTarget); 93 94 if ( (pcszSource) 95 && (ulLength = strlen(pcszSource)) 96 ) 97 { 98 if (*ppszTarget = (PSZ)malloc(ulLength + 1)) 99 memcpy(*ppszTarget, pcszSource, ulLength + 1); 100 } 101 else 102 *ppszTarget = NULL; 103 } 104 105 if (pulLength) 106 *pulLength = ulLength; 107 } 69 108 70 109 /*
Note:
See TracChangeset
for help on using the changeset viewer.