summaryrefslogtreecommitdiff
path: root/sys/src/cmd/unix/u9fs/strecpy.c
blob: 57cedf80863fd776c4c273586e1356d46fcc46b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <plan9.h>

char*
strecpy(char *to, char *e, char *from)
{
	if(to >= e)
		return to;
	to = memccpy(to, from, '\0', e - to);
	if(to == nil){
		to = e - 1;
		*to = '\0';
	}
	return to;
}