xref: /netbsd-src/lib/libc/string/wmempcpy.c (revision 6a8ddfc01822c1247f7a6ec7e864b5a28eb56027)
1*6a8ddfc0Schristos /*	$NetBSD: wmempcpy.c,v 1.1 2023/07/31 17:38:28 christos Exp $	*/
2*6a8ddfc0Schristos 
3*6a8ddfc0Schristos /*-
4*6a8ddfc0Schristos  * Copyright (c) 2022 The NetBSD Foundation, Inc.
5*6a8ddfc0Schristos  * All rights reserved.
6*6a8ddfc0Schristos  *
7*6a8ddfc0Schristos  * Redistribution and use in source and binary forms, with or without
8*6a8ddfc0Schristos  * modification, are permitted provided that the following conditions
9*6a8ddfc0Schristos  * are met:
10*6a8ddfc0Schristos  * 1. Redistributions of source code must retain the above copyright
11*6a8ddfc0Schristos  *    notice, this list of conditions and the following disclaimer.
12*6a8ddfc0Schristos  * 2. Redistributions in binary form must reproduce the above copyright
13*6a8ddfc0Schristos  *    notice, this list of conditions and the following disclaimer in the
14*6a8ddfc0Schristos  *    documentation and/or other materials provided with the distribution.
15*6a8ddfc0Schristos  *
16*6a8ddfc0Schristos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17*6a8ddfc0Schristos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18*6a8ddfc0Schristos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19*6a8ddfc0Schristos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20*6a8ddfc0Schristos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*6a8ddfc0Schristos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*6a8ddfc0Schristos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*6a8ddfc0Schristos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*6a8ddfc0Schristos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*6a8ddfc0Schristos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*6a8ddfc0Schristos  * POSSIBILITY OF SUCH DAMAGE.
27*6a8ddfc0Schristos  */
28*6a8ddfc0Schristos 
29*6a8ddfc0Schristos #include <sys/cdefs.h>
30*6a8ddfc0Schristos __RCSID("$NetBSD: wmempcpy.c,v 1.1 2023/07/31 17:38:28 christos Exp $");
31*6a8ddfc0Schristos 
32*6a8ddfc0Schristos #include <string.h>
33*6a8ddfc0Schristos #include <wchar.h>
34*6a8ddfc0Schristos 
35*6a8ddfc0Schristos wchar_t *
wmempcpy(wchar_t * __restrict dst,const wchar_t * __restrict src,size_t len)36*6a8ddfc0Schristos wmempcpy(wchar_t *__restrict dst, const wchar_t *__restrict src, size_t len)
37*6a8ddfc0Schristos {
38*6a8ddfc0Schristos 	return wmemcpy(dst, src, len) + len;
39*6a8ddfc0Schristos }
40