Changeset 108 for trunk/src/helpers/xstring.c
- Timestamp:
- Oct 13, 2001, 7:57:58 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/xstring.c
r91 r108 379 379 380 380 /* 381 *@@ xstrShrink: 382 * reallocates the string buffer so that it 383 * is exactly the length of the string with 384 * its null byte, if the string has excessive 385 * memory allocated. Useful if you are sure 386 * that the string won't grow again. 387 * 388 *@@added V0.9.16 (2001-10-08) [umoeller] 389 */ 390 391 void XWPENTRY xstrShrink(PXSTRING pxstr) 392 { 393 if ( (pxstr) 394 && (pxstr->psz) 395 && (pxstr->cbAllocated > pxstr->ulLength + 1) 396 ) 397 { 398 pxstr->psz = realloc(pxstr->psz, 399 pxstr->ulLength + 1); 400 pxstr->cbAllocated = pxstr->ulLength + 1; 401 } 402 } 403 404 /* 381 405 *@@ xstrCreate: 382 406 * allocates a new XSTRING from the heap
Note:
See TracChangeset
for help on using the changeset viewer.