]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/port/strncat.c
libregexp: improve the transition to next available thread, instruction, and generation
[plan9front.git] / sys / src / libc / port / strncat.c
1 #include <u.h>
2 #include <libc.h>
3
4 char*
5 strncat(char *s1, char *s2, long n)
6 {
7         char *os1;
8
9         os1 = s1;
10         while(*s1++)
11                 ;
12         s1--;
13         while(*s1++ = *s2++)
14                 if(--n < 0) {
15                         s1[-1] = 0;
16                         break;
17                 }
18         return os1;
19 }