add a missing section header table index conversion
[tangerine.git] / compiler / clib / strncat.c
blob129804f5bcb2347b6f34d1e898c05193f93e3553
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function strncat().
6 */
8 /*****************************************************************************
10 NAME */
11 #include <string.h>
13 char * strncat (
15 /* SYNOPSIS */
16 char * dest,
17 const char * src,
18 size_t n)
20 /* FUNCTION
21 Concatenates two strings. If src is longer than n characters, then
22 only the first n characters are copied.
24 INPUTS
25 dest - src is appended to this string. Make sure that there
26 is enough room for src.
27 src - This string is appended to dest
28 n - No more than this number of characters of src are copied.
30 RESULT
31 dest.
33 NOTES
34 The routine makes no checks if dest is large enough. The size of
35 dest must be at least strlen(dest)+n+1.
37 EXAMPLE
38 char buffer[64];
40 strcpy (buffer, "Hello ");
41 strncat (buffer, "World.!!", 6);
43 // Buffer now contains "Hello World."
45 BUGS
47 SEE ALSO
49 INTERNALS
51 ******************************************************************************/
53 char * d = dest;
55 while (*dest)
56 dest ++;
58 while (n && (*dest = *src))
60 n --;
61 dest ++; src ++;
63 *dest = 0; /* null-terminate conctenated string */
65 return d;
66 } /* strncat */