about summary refs log tree commit diff
path: root/sysdeps/generic/memchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/memchr.c')
-rw-r--r--sysdeps/generic/memchr.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sysdeps/generic/memchr.c b/sysdeps/generic/memchr.c
index c8926c7b38..9ea9ce25c8 100644
--- a/sysdeps/generic/memchr.c
+++ b/sysdeps/generic/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993, 1996, 1997, 1999 Free Software Foundation, Inc.
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
    with help from Dan Sahlin (dan@sics.se) and
    commentary by Jim Blandy (jimb@ai.mit.edu);
@@ -33,6 +33,9 @@
 
 #if defined (_LIBC)
 # include <string.h>
+# include <memcopy.h>
+#else
+# define reg_char char
 #endif
 
 #if defined (HAVE_LIMITS_H) || defined (_LIBC)
@@ -52,16 +55,17 @@
 
 /* Search no more than N bytes of S for C.  */
 __ptr_t
-memchr (s, c, n)
+memchr (s, c_in, n)
      const __ptr_t s;
-     int c;
+     int c_in;
      size_t n;
 {
   const unsigned char *char_ptr;
   const unsigned long int *longword_ptr;
   unsigned long int longword, magic_bits, charmask;
+  unsigned reg_char c;
 
-  c = (unsigned char) c;
+  c = (unsigned char) c_in;
 
   /* Handle the first few characters by reading one character at a time.
      Do this until CHAR_PTR is aligned on a longword boundary.  */