]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/port/strecpy.c
libregexp: improve the transition to next available thread, instruction, and generation
[plan9front.git] / sys / src / libc / port / strecpy.c
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 }