Everything

strncpy


Character string copy with number of characters specified

[Classification]

Standard library

[Syntax]

#include <string.h>

char __near * __far strncpy(char __near *s1, const char __near *s2, size_t n); (C90)

char __near * __far strncpy(char __near * restrict s1, const char __near * restrict s2, size_t n); (C99) [V1.07 or later]

char __far * __far _COM_strncpy_ff(char __far *s1, const char __far *s2, size_t n); (C90)

char __far * __far _COM_strncpy_ff(char __far * restrict s1, const char __far * restrict s2, size_t n); (C99) [V1.07 or later]

[Return value]

Returns the value of s1.

[Description]

This function copies up to n characters (null character and string following the null character are not appended) from the array indicated by s2 to the array indicated by s1. If the array indicate by s2 is shorter than n characters, null characters (\0) are appended to the duplication in the array indicated by s1, until all n characters are written. If the array indicated by s2 is equal to or greater than n characters, null characters are not appended.

The operation is undefined if the copy source and copy destination areas overlap.