home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / ncftp / older_versions / ncftp-3.2.2-src.tar.bz2 / ncftp-3.2.2-src.tar / ncftp-3.2.2 / Strn / DStrFree.c < prev    next >
C/C++ Source or Header  |  2001-11-19  |  387b  |  27 lines

  1. #include "syshdrs.h"
  2. #ifdef PRAGMA_HDRSTOP
  3. #    pragma hdrstop
  4. #endif
  5.  
  6. void
  7. DStrClear(DStr *const dst)
  8. {
  9.     if (! IS_DSTR_CORRUPT(dst)) {
  10.         if (dst->s != NULL)
  11.             memset(dst->s, 0, dst->allocSize);
  12.         dst->len = 0;
  13.     }
  14. }    /* DStrClear */
  15.  
  16.  
  17.  
  18. void
  19. DStrFree(DStr *const dst)
  20. {
  21.     if (! IS_DSTR_CORRUPT(dst)) {
  22.         if (dst->s != NULL)
  23.             free(dst->s);
  24.     }
  25.     memset(dst, 0, sizeof(DStr));
  26. }    /* DStrFree */
  27.