ref: 65ef69a85d1c0f4694a361f5a0a99bdbb4f2cd95
dir: /sys/src/libc/port/strecpy.c/
#include <u.h> #include <libc.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'; }else{ to--; } return to; }