unincpy

Copies a specified number of Unicode characters from one string to another string.

Library:LibC
Service:Characters and Strings

Syntax

  #include <unilib.h> 
   
  unicode_t *unincpy (
     unicode_t         *tgt,
     const unicode_t   *src,
     size_t             n);
  

Parameters

tgt

(OUT) Points to the array for the copied string.

src

(IN) Points to the array for the Unicode string to copy.

n

(IN) Specifies the number of Unicode characters to copy.

Return Values

Returns the address of the tgt parameter.

Remarks

The unincpy function corresponds to the strncpy function.

The unincpy function copies up to the number of characters specified by the n parameter from the source string in the src parameter to the destination string in the tgt parameter and truncates the src parameter if necessary. The destination string in the tgt parameter might not be null-terminated if the length of the tgt parameter is the number of characters specified by the n parameter or more.

If the string pointed to by src is shorter than n characters, null-terminating characters are appended to the copy in the array pointed to by tgt, until n characters in all have been written. If the string pointed to by src is longer than n characters, only n characters are copied. No null-terminating characters are placed in tgt.

See Also