aboutsummaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCompilerAI Research Group <bugs@compiler.ai>2023-01-03 14:45:37 -0500
committerJeff Johnston <jjohnstn@redhat.com>2023-01-03 14:52:47 -0500
commitad3f9820b16a3dc5ea6237106436f565fcb2ed3e (patch)
tree7c5f3948ad525efa6da6979129bfb1dcc0dc6bbf /newlib
parentb5d4245d5f99b61a64e65be45872a2f56fd3e37e (diff)
downloadnewlib-ad3f9820b16a3dc5ea6237106436f565fcb2ed3e.zip
newlib-ad3f9820b16a3dc5ea6237106436f565fcb2ed3e.tar.gz
newlib-ad3f9820b16a3dc5ea6237106436f565fcb2ed3e.tar.bz2
Fix memccpy to handle end char >= x80
- use unsigned char variables for optimized version of memccpy
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libc/string/memccpy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/string/memccpy.c b/newlib/libc/string/memccpy.c
index 1f5f55c..6757cb3 100644
--- a/newlib/libc/string/memccpy.c
+++ b/newlib/libc/string/memccpy.c
@@ -80,11 +80,11 @@ memccpy (void *__restrict dst0,
return ptr;
#else
void *ptr = NULL;
- char *dst = dst0;
- const char *src = src0;
+ unsigned char *dst = dst0;
+ const unsigned char *src = src0;
long *aligned_dst;
const long *aligned_src;
- char endchar = endchar0 & 0xff;
+ unsigned char endchar = endchar0 & 0xff;
/* If the size is small, or either SRC or DST is unaligned,
then punt into the byte copy loop. This should be rare. */