Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE UChar* U_EXPORT2 u_strncpy ( UChar *  dst,
const UChar *  src,
int32_t  n 
)

Copy a ustring. Copies at most n characters. The result will be null terminated if the length of src is less than n.

Parameters:
dst The destination string.
src The source string.
n The maximum number of characters to copy.
Returns:
A pointer to dst. ICU 2.0

Definition at line 975 of file ustring.c.

{
    UChar *anchor = dst;            /* save a pointer to start of dst */

    /* copy string 2 over */
    while(n > 0 && (*(dst++) = *(src++)) != 0) {
        --n;
    }

    return anchor;
}


Generated by  Doxygen 1.6.0   Back to index