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 <u.h>
2
#include <libc.h>
3
 
4
char*
5
strecpy(char *to, char *e, char *from)
6
{
7
	if(to >= e)
8
		return to;
9
	to = memccpy(to, from, '\0', e - to);
10
	if(to == nil){
11
		to = e - 1;
12
		*to = '\0';
13
	}else{
14
		to--;
15
	}
16
	return to;
17
}