public inbox for
help / color / mirror / Atom feed
From: Jeff Johnston <>
Subject: [newlib-cygwin] Fix memccpy to handle end char >= x80
Date: Tue,  3 Jan 2023 19:53:08 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=ad3f9820b16a3dc5ea6237106436f565fcb2ed3e

commit ad3f9820b16a3dc5ea6237106436f565fcb2ed3e
Author: CompilerAI Research Group <>
Date:   Tue Jan 3 14:45:37 2023 -0500

    Fix memccpy to handle end char >= x80
    - use unsigned char variables for optimized version of memccpy

 newlib/libc/string/memccpy.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/newlib/libc/string/memccpy.c b/newlib/libc/string/memccpy.c
index 1f5f55c50..6757cb34c 100644
--- a/newlib/libc/string/memccpy.c
+++ b/newlib/libc/string/memccpy.c
@@ -80,11 +80,11 @@ memccpy (void *__restrict dst0,
   return ptr;
   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.  */

                 reply	other threads:[~2023-01-03 19:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).