lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2002 Manuel Novoa III |
| 3 | * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> |
| 4 | * |
| 5 | * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. |
| 6 | */ |
| 7 | |
| 8 | #include "_string.h" |
| 9 | |
| 10 | #ifdef __UCLIBC_SUSV3_LEGACY__ |
| 11 | |
| 12 | |
| 13 | void bcopy(const void *s2, void *s1, size_t n) |
| 14 | { |
| 15 | #if 1 |
| 16 | memmove(s1, s2, n); |
| 17 | #else |
| 18 | register char *s; |
| 19 | register const char *p; |
| 20 | |
| 21 | s = s1; |
| 22 | p = s2; |
| 23 | if (p >= s) { |
| 24 | while (n) { |
| 25 | *s++ = *p++; |
| 26 | --n; |
| 27 | } |
| 28 | } else { |
| 29 | while (n) { |
| 30 | --n; |
| 31 | s[n] = p[n]; |
| 32 | } |
| 33 | } |
| 34 | #endif |
| 35 | } |
| 36 | #endif |