File:  [MW Coherent from dump] / coherent / b / lib / libc / string / strncpy.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * strncpy.c
 * ANSI 4.11.2.4.
 * Copy one fixed length string to another.
 */

#include <string.h>

char *strncpy(s1, s2, n) char *s1; char *s2; size_t n;
{
	register char *cp;

	for (cp = s1; n; ) {
		n--;
		if ((*cp++ = *s2++) == '\0')
			break;
	}
	/* Pad remainder of s1 with NUL if required. */
	while (n-- > 0)
		*cp++ = '\0';
	return (s1);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.