FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
strw_assign.c
Go to the documentation of this file.
1
/* unicode string assigning function */
2
3
#include "
fb.h
"
4
5
FBCALL
FB_WCHAR
*
fb_WstrAssign
(
FB_WCHAR
*dst, ssize_t dst_chars,
FB_WCHAR
*src )
6
{
7
ssize_t src_chars;
8
9
if
( dst ==
NULL
)
10
return
dst;
11
12
if
( src == 0 )
13
src_chars = 0;
14
else
15
src_chars =
fb_wstr_Len
( src );
16
17
/* src NULL? */
18
if
( src_chars == 0 )
19
{
20
*dst = 0;
21
}
22
else
23
{
24
if
( dst_chars > 0 )
25
{
26
--dst_chars;
/* less the null-term */
27
/* not enough? clamp */
28
if
( dst_chars < src_chars )
29
src_chars = dst_chars;
30
}
31
32
fb_wstr_Copy
( dst, src, src_chars );
33
}
34
35
return
dst;
36
}
rtlib
strw_assign.c
Generated on Thu Jan 23 2014 19:40:13 for FreeBASIC by
1.8.4