Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
|
#include <string.h>
Go to the source code of this file.
Functions | |
char * | strncpy (char *__restrict dst, const char *__restrict src, size_t maxlen) |
Copies at most maxlen characters of the character array pointed to by src to character array pointed to by dest. More... | |
char* strncpy | ( | char *__restrict | dst, |
const char *__restrict | src, | ||
size_t | maxlen | ||
) |
Copies at most maxlen characters of the character array pointed to by src to character array pointed to by dest.
Copies at most maxlen characters of the character array pointed to by src (including the terminating null character, but not any of the characters that follow the null character) to character array pointed to by dest. If maxlen is reached before the entire array src was copied, the resulting character array is not null-terminated. If, after copying the terminating null character from src, maxlen is not reached, additional null characters are written to dest until the total of maxlen characters have been written.
The behavior is undefined if the character arrays overlap, if either dest or src is not a pointer to a character array (including if dest or src is a null pointer), if the size of the array pointed to by dest is less than maxlen, or if the size of the array pointed to by src is less than maxlen and it does not contain a null character.
dst | pointer to the character array to copy to |
src | pointer to the character array to copy from |
maxlen | maximum number of characters to copy |
Definition at line 26 of file strncpy.c.