]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdio-common/reg-modifier.c
[powerpc] No need to enter "Ignore Exceptions Mode"
[thirdparty/glibc.git] / stdio-common / reg-modifier.c
index beec2ecbe3457b27aa229aaf5f93d4e60eeba730..d11f099c47026b905542a56ff59c55da9001bd3a 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -39,7 +39,7 @@ static int next_bit;
 
 
 int
-__register_printf_modifier (wchar_t *str)
+__register_printf_modifier (const wchar_t *str)
 {
   if (str[0] == L'\0')
     {
@@ -48,7 +48,7 @@ __register_printf_modifier (wchar_t *str)
       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;
@@ -82,7 +82,7 @@ __register_printf_modifier (wchar_t *str)
 
   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;