source:
sbliveos2/trunk/lib32/strncpy.c@
199
| Last change on this file since 199 was 142, checked in by , 26 years ago | |
|---|---|
|
|
| File size: 380 bytes | |
| Line | |
|---|---|
| 1 | /* $Id: strncpy.c 142 2000-04-23 14:55:46Z ktk $ */ |
| 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.
