FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
strw_concatassign.c
Go to the documentation of this file.
1
/* string concat and assign (s = s + expr) function */
2
3
#include "
fb.h
"
4
5
FBCALL
FB_WCHAR
*
fb_WstrConcatAssign
(
FB_WCHAR
*dst, ssize_t dst_chars,
const
FB_WCHAR
*src )
6
{
7
ssize_t src_len, dst_len;
8
9
/* NULL? */
10
if
( (dst ==
NULL
) || (src ==
NULL
) )
11
return
dst;
12
13
src_len =
fb_wstr_Len
( src );
14
if
( src_len == 0 )
15
return
dst;
16
17
dst_len =
fb_wstr_Len
( dst );
18
19
/* don't check ptr's */
20
if
( dst_chars > 0 )
21
{
22
--dst_chars;
/* less the null-term */
23
24
if
( src_len > dst_chars - dst_len )
25
src_len = dst_chars - dst_len;
26
}
27
28
/* copy the null-term too */
29
fb_wstr_Move
( &dst[dst_len], src, src_len + 1 );
30
31
return
dst;
32
}
rtlib
strw_concatassign.c
Generated on Thu Jan 23 2014 19:40:13 for FreeBASIC by
1.8.4