Subversion Repositories shark

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/* Project:     OSLib
2
 * Description: The OS Construction Kit
3
 * Date:                1.6.2000
4
 * Idea by:             Luca Abeni & Gerardo Lamastra
5
 *
6
 * OSLib is an SO project aimed at developing a common, easy-to-use
7
 * low-level infrastructure for developing OS kernels and Embedded
8
 * Applications; it partially derives from the HARTIK project but it
9
 * currently is independently developed.
10
 *
11
 * OSLib is distributed under GPL License, and some of its code has
12
 * been derived from the Linux kernel source; also some important
13
 * ideas come from studying the DJGPP go32 extender.
14
 *
15
 * We acknowledge the Linux Community, Free Software Foundation,
16
 * D.J. Delorie and all the other developers who believe in the
17
 * freedom of software and ideas.
18
 *
19
 * For legalese, check out the included GPL license.
20
 */
21
 
22
#include <ll/i386/string.h>
23
 
24
FILE(strncat);
25
 
26
/*
27
 * Concatenate src on the end of dst.  At most strlen(dst)+n+1 bytes
28
 * are written at dst (at most n+1 bytes being appended).  Return dst.
29
 */
30
char *strncat(char *dest, const char *src, int n)
31
{
32
        if (n != 0) {
33
                char *d = dest;
34
                const char *s = src;
35
 
36
                while (*d != 0)
37
                        d++;
38
                do {
39
                        if ((*d = *s++) == 0)
40
                                break;
41
                        d++;
42
                } while (--n != 0);
43
                *d = 0;
44
        }
45
        return (dest);
46
}