Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <string.h>
2
 
3
char*
4
strncat(char *s1, const char *s2, size_t n)
5
{
6
	char *os1;
7
	long nn;
8
 
9
	os1 = s1;
10
	nn = n;
11
	while(*s1++)
12
		;
13
	s1--;
14
	while(*s1++ = *s2++)
15
		if(--nn < 0) {
16
			s1[-1] = 0;
17
			break;
18
		}
19
	return os1;
20
}