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
strncpy(char *s1, const char *s2, size_t n)
5
{
6
	int i;
7
	char *os1;
8
 
9
	os1 = s1;
10
	for(i = 0; i < n; i++)
11
		if((*s1++ = *s2++) == 0) {
12
			while(++i < n)
13
				*s1++ = 0;
14
			return os1;
15
		}
16
	return os1;
17
}