FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
mem_copyclear.c
Go to the documentation of this file.
1
/* LSET for non-strings */
2
3
#include "
fb.h
"
4
5
FBCALL
void
fb_MemCopyClear
6
(
7
unsigned
char
*dst,
8
ssize_t dstlen,
9
unsigned
char
*src,
10
ssize_t srclen
11
)
12
{
13
ssize_t bytes;
14
15
if
( (dst ==
NULL
) || (src ==
NULL
) || (dstlen <= 0) || (srclen <= 0) )
16
return
;
17
18
bytes = (dstlen <= srclen? dstlen: srclen);
19
20
/* move */
21
memcpy( dst, src, bytes );
22
23
/* clear remainder */
24
dstlen -= bytes;
25
if
( dstlen > 0 )
26
memset( &dst[bytes], 0, dstlen );
27
}
rtlib
mem_copyclear.c
Generated on Thu Jan 23 2014 19:40:12 for FreeBASIC by
1.8.4