source:
bootcd/isolinux/syslinux-6.03/com32/lib/stpncpy.c
@
dd1be7c
Last change on this file since dd1be7c was e16e8f2, checked in by , 3 years ago | |
---|---|
|
|
File size: 256 bytes |
Rev | Line | |
---|---|---|
[e16e8f2] | 1 | /* |
2 | * stpncpy.c | |
3 | * | |
4 | * stpncpy() | |
5 | */ | |
6 | ||
7 | #include <string.h> | |
8 | ||
9 | char *stpncpy(char *dst, const char *src, size_t n) | |
10 | { | |
11 | char *q = dst; | |
12 | const char *p = src; | |
13 | char ch; | |
14 | ||
15 | while (n--) { | |
16 | *q = ch = *p++; | |
17 | if (!ch) | |
18 | break; | |
19 | q++; | |
20 | } | |
21 | ||
22 | return q; | |
23 | } |
Note: See TracBrowser
for help on using the repository browser.