about summary refs log tree commit diff
path: root/sysdeps/generic/memccpy.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-05-07 22:33:59 +0000
committerUlrich Drepper <drepper@redhat.com>2000-05-07 22:33:59 +0000
commit74a0513daf4ea71825ffe545982724cfa3741b24 (patch)
tree15431f4e2157bea8855d62432b224b2067e1c3ad /sysdeps/generic/memccpy.c
parentfc08075dc61787269743a1abb8ff8221868c3210 (diff)
downloadglibc-74a0513daf4ea71825ffe545982724cfa3741b24.tar.gz
glibc-74a0513daf4ea71825ffe545982724cfa3741b24.tar.xz
glibc-74a0513daf4ea71825ffe545982724cfa3741b24.zip
Update.
	* sysdeps/generic/memccpy.c (__memccpy): Don't use reg_char type
	for x since promotion in comparison might leads to unexpected
	results.  Reported by Dan Pop <Dan.Pop@cern.ch>.
Diffstat (limited to 'sysdeps/generic/memccpy.c')
-rw-r--r--sysdeps/generic/memccpy.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sysdeps/generic/memccpy.c b/sysdeps/generic/memccpy.c
index f7b496de9f..195c3b4399 100644
--- a/sysdeps/generic/memccpy.c
+++ b/sysdeps/generic/memccpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1997, 1999, 2000 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
@@ -17,7 +17,6 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <string.h>
-#include <memcopy.h>
 
 #undef __memccpy
 #undef memccpy
@@ -27,12 +26,14 @@
    NULL if C was not found in the first N bytes of SRC.  */
 void *
 __memccpy (dest, src, c, n)
-      void *dest; const void *src;
-      int c; size_t n;
+      void *dest;
+      const void *src;
+      int c;
+      size_t n;
 {
   register const char *s = src;
   register char *d = dest;
-  register const reg_char x = (unsigned char) c;
+  register const char x = c;
   register size_t i = n;
 
   while (i-- > 0)