IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 5, 2010, 9:25:07 PM (15 years ago)
Author:
eugene
Message:

add psStringRealloc function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psString.c

    r19070 r29932  
    4848    psString string = p_psAlloc(file, lineno, func, nChar + 1);
    4949    psMemSetDeallocator(string, (psFreeFunc)stringFree);
     50
     51    return string;
     52}
     53
     54
     55psString p_psStringRealloc(const char *file,
     56                           unsigned int lineno,
     57                           const char *func,
     58                           psString string,
     59                           size_t nChar)
     60{
     61    if (!string) {
     62        string = p_psAlloc(file, lineno, func, nChar + 1);
     63        psMemSetDeallocator(string, (psFreeFunc)stringFree);
     64    } else {
     65        string = p_psRealloc(file, lineno, func, string, nChar + 1);
     66    }
    5067
    5168    return string;
Note: See TracChangeset for help on using the changeset viewer.