-/* Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
#include <wchar.h>
{
wchar_t *wcp = (wchar_t *) dest - 1;
wint_t c;
- const ptrdiff_t off = src - dest + 1;
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
- c = wcp[off];
+ c = *src++;
*++wcp = c;
}
while (c != L'\0');