* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)strncpy.c 5.6 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
* Copy src to dst, truncating or null-padding to always copy n bytes.
register const char *s
= src
;
if ((*d
++ = *s
++) == 0) {
/* NUL pad the remaining n-1 bytes */