c/string/byte/strncpy

@1@ Copies at most characters of the character array pointed to by  (including the terminating null character, but not any of the characters that follow the null character) to character array pointed to by. @@ If is reached before the entire array  was copied, the resulting character array is not null-terminated. @@ If, after copying the terminating null character from, is not reached, additional null characters are written to  until the total of  characters have been written. @@The behavior is undefined if the character arrays overlap, if either or  is not a pointer to a character array (including if  or  is a null pointer), if the size of the array pointed to by  is less than, or if the size of the array pointed to by  is less than  and it does not contain a null character. @2@ Same as, except that the function does not continue writing zeroes into the destination array to pad up to , it stops after writing the terminating null character (if there was no null in the source, it writes one at and then stops). Also, the following errors are detected at runtime and call the currently installed constraint handler function:
 * or is a null pointer
 * is zero or greater than rsize_max
 * is greater than rsize_max
 * is greater or equal, but is less or equal , in other words, truncation would occur
 * overlap would occur between the source and the destination strings

@@The behavior is undefined if the size of the character array pointed to by <  <= ; in other words, an erroneous value of  does not expose the impending buffer overflow. The behavior is undefined if the size of the character array pointed to by <  < ; in other words, an erroneous value of  does not expose the impending buffer overflow.

Return value
@1@ returns a copy of @2@ returns zero on success, returns non-zero on error. Also, on error, writes zero to (unless  is a null pointer or  is zero or greater than rsize_max) and may clobber the rest of the destination array with unspecified values.