bump for release 1.0.29
[uclibc-ng.git] / libc / string / memmove.c
blobb768b6ea9a74b679ef620aaad3120984ca3ed820
1 /*
2 * Copyright (C) 2002 Manuel Novoa III
3 * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6 */
8 #include "_string.h"
10 #ifdef WANT_WIDE
11 # define Wmemmove wmemmove
12 #else
13 # define Wmemmove memmove
14 #endif
16 Wvoid *Wmemmove(Wvoid *s1, const Wvoid *s2, size_t n)
18 register Wchar *s = (Wchar *) s1;
19 register const Wchar *p = (const Wchar *) s2;
21 if (p >= s) {
22 while (n) {
23 *s++ = *p++;
24 --n;
26 } else {
27 while (n) {
28 --n;
29 s[n] = p[n];
33 return s1;
36 #ifndef WANT_WIDE
37 libc_hidden_def(memmove)
38 #endif