xref: /plan9/sys/src/cmd/unix/u9fs/strecpy.c (revision a84536681645e23c630ce4ef2e5c3b284d4c590b)
1 #include <plan9.h>
2 
3 char*
4 strecpy(char *to, char *e, char *from)
5 {
6 	if(to >= e)
7 		return to;
8 	to = memccpy(to, from, '\0', e - to);
9 	if(to == nil){
10 		to = e - 1;
11 		*to = '\0';
12 	}
13 	return to;
14 }
15