From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2134) id C7BCC3858D1E; Tue, 3 Jan 2023 19:53:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7BCC3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672775588; bh=yiga+4sBlzCoQovJ2DSToIHFTwLQkxvjsyIWADfvuSU=; h=From:To:Subject:Date:From; b=yoCIqyjDyMzmIeqVcW7PdPJ4fVZ1lnNgeDe4pewmkEQtOjfs894PCxEkaYujZjFEl 99TAtp5rARLfZloVNvzIwTroHodfLKXCqs9yytpa4kxVtyaZCMI4qsDvLXgvA1mzL5 NcOAGRrHo1ZRHEkAjQGqZjFLpAsqVQW87C9rr/9U= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jeff Johnston To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix memccpy to handle end char >= x80 X-Act-Checkin: newlib-cygwin X-Git-Author: CompilerAI Research Group X-Git-Refname: refs/heads/master X-Git-Oldrev: b5d4245d5f99b61a64e65be45872a2f56fd3e37e X-Git-Newrev: ad3f9820b16a3dc5ea6237106436f565fcb2ed3e Message-Id: <20230103195308.C7BCC3858D1E@sourceware.org> Date: Tue, 3 Jan 2023 19:53:08 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dad3f9820b16= a3dc5ea6237106436f565fcb2ed3e commit ad3f9820b16a3dc5ea6237106436f565fcb2ed3e Author: CompilerAI Research Group Date: Tue Jan 3 14:45:37 2023 -0500 Fix memccpy to handle end char >=3D x80 =20 - use unsigned char variables for optimized version of memccpy Diff: --- 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; #else void *ptr =3D NULL; - char *dst =3D dst0; - const char *src =3D src0; + unsigned char *dst =3D dst0; + const unsigned char *src =3D src0; long *aligned_dst; const long *aligned_src; - char endchar =3D endchar0 & 0xff; + unsigned char endchar =3D endchar0 & 0xff; =20 /* If the size is small, or either SRC or DST is unaligned, then punt into the byte copy loop. This should be rare. */