/*		Q/C V3.2 Utility Library		*/
/*     Copyright (c) 1984 Quality Computer Systems	*/
/*			11/25/84			*/

#include "stdio.h"

/* add at most n characters from second string to end of first string */
char *strncat(s1, s2, n)
char *s1, *s2;
	{
	register char *p;

	p = s1;
	while (*p)		/* find end of first string */
		++p;
	while (n--) {		/* copy 2nd string to end of 1st */
		if ((*p = *s2++) == '\0')
			break;
		else
			++p;
		}
	*p = '\0';
	return s1;
	}
