Ignore:
Timestamp:
Oct 13, 2001, 7:57:58 PM (24 years ago)
Author:
umoeller
Message:

Lots of updates from the last week for conditional compiles and other stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/xstring.c

    r91 r108  
    379379
    380380/*
     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
     391void 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/*
    381405 *@@ xstrCreate:
    382406 *      allocates a new XSTRING from the heap
Note: See TracChangeset for help on using the changeset viewer.