source:
GPL/lib32/strncpy.c@
18
Last change on this file since 18 was 18, checked in by , 20 years ago | |
---|---|
File size: 455 bytes |
Line | |
---|---|
1 | /* $Id: strncpy.c,v 1.1.1.1 2003/07/02 13:57:02 eleph Exp $ */ |
2 | |
3 | /* strncpy.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ |
4 | |
5 | #include <string.h> |
6 | |
7 | char *strncpy (char *string1, const char *string2, size_t count) |
8 | { |
9 | char *dst; |
10 | |
11 | dst = string1; |
12 | while (count > 0 && *string2 != 0) |
13 | { |
14 | *dst++ = *string2++; |
15 | --count; |
16 | } |
17 | while (count > 0) |
18 | { |
19 | *dst++ = 0; |
20 | --count; |
21 | } |
22 | return string1; |
23 | } |
Note:
See TracBrowser
for help on using the repository browser.