-/* Copyright (C) 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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 <errno.h>
#include <limits.h>
#include <printf.h>
+#include <stdlib.h>
#include <wchar.h>
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
struct printf_modifier_record
int
-__register_printf_modifier (wchar_t *str)
+__register_printf_modifier (const wchar_t *str)
{
if (str[0] == L'\0')
{
return -1;
}
- wchar_t *wc = str;
+ const wchar_t *wc = str;
while (*wc != L'\0')
if (*wc < 0 || *wc > (wchar_t) UCHAR_MAX)
goto einval;
newp->next = __printf_modifier_table[(unsigned char) *str];
newp->bit = 1 << next_bit++;
- wmemcpy (newp->str, str + 1, wc - str);
+ __wmemcpy (newp->str, str + 1, wc - str);
__printf_modifier_table[(unsigned char) *str] = newp;