u9fs/strecpy.c
charles forsyth 44b904efbb 20110512-2206
2011-05-12 22:06:54 +01:00

15 lines
193 B
C

#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;
}