File: DStrFree.c

package info (click to toggle)
ncftp 2%3A3.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,124 kB
  • sloc: ansic: 41,900; sh: 3,577; perl: 874; makefile: 854; cpp: 612
file content (26 lines) | stat: -rw-r--r-- 387 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "syshdrs.h"
#ifdef PRAGMA_HDRSTOP
#	pragma hdrstop
#endif

void
DStrClear(DStr *const dst)
{
	if (! IS_DSTR_CORRUPT(dst)) {
		if (dst->s != NULL)
			memset(dst->s, 0, dst->allocSize);
		dst->len = 0;
	}
}	/* DStrClear */



void
DStrFree(DStr *const dst)
{
	if (! IS_DSTR_CORRUPT(dst)) {
		if (dst->s != NULL)
			free(dst->s);
	}
	memset(dst, 0, sizeof(DStr));
}	/* DStrFree */