Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/strncat.c
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 279 byte(s)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 279 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | /* |
2 | * strncat.c |
3 | */ |
4 | |
5 | #include <string.h> |
6 | #include <klibc/compiler.h> |
7 | |
8 | char *strncat(char *dst, const char *src, size_t n) |
9 | { |
10 | char *q = strchr(dst, '\0'); |
11 | const char *p = src; |
12 | char ch; |
13 | |
14 | while (n--) { |
15 | *q++ = ch = *p++; |
16 | if (!ch) |
17 | return dst; |
18 | } |
19 | *q = '\0'; |
20 | |
21 | return dst; |
22 | } |