From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id B04C2385801A for ; Sat, 27 Mar 2021 17:52:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B04C2385801A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (port=35327 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1lQD6f-0002j3-IP; Sat, 27 Mar 2021 17:52:17 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1lQD6f-0005ZC-FN; Sat, 27 Mar 2021 18:52:17 +0100 From: Florian Weimer To: "H.J. Lu" Cc: "H.J. Lu via Libc-alpha" Subject: Re: [PATCH v2] Initialize wchar_t string with wmemset [BZ #27655] References: <20210327162433.3215479-1-hjl.tools@gmail.com> <87lfa88p8l.fsf@mid.deneb.enyo.de> Date: Sat, 27 Mar 2021 18:52:17 +0100 In-Reply-To: (H. J. Lu's message of "Sat, 27 Mar 2021 10:49:45 -0700") Message-ID: <87blb48oxa.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 17:52:19 -0000 * H. J. Lu: > Subject: [PATCH v2] Initialize wchar_t string with wmemset [BZ #27655] > > Use wmemset to initialize wchar_t string. > --- > string/test-strnlen.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/string/test-strnlen.c b/string/test-strnlen.c > index a49d93afa2..b98dc10a56 100644 > --- a/string/test-strnlen.c > +++ b/string/test-strnlen.c > @@ -27,6 +27,7 @@ > > #ifndef WIDE > # define STRNLEN strnlen > +# define MEMSET memset > # define CHAR char > # define BIG_CHAR CHAR_MAX > # define MIDDLE_CHAR 127 > @@ -34,6 +35,7 @@ > #else > # include > # define STRNLEN wcsnlen > +# define MEMSET wmemset > # define CHAR wchar_t > # define BIG_CHAR WCHAR_MAX > # define MIDDLE_CHAR 1121 > @@ -153,7 +155,7 @@ do_page_tests (void) > size_t last_offset = (page_size / sizeof (CHAR)) - 1; > > CHAR *s = (CHAR *) buf2; > - memset (s, 65, (last_offset - 1)); > + MEMSET (s, 65, (last_offset - 1)); > s[last_offset] = 0; > > /* Place short strings ending at page boundary. */ Patch looks good. Please change the commit message to mention that this changes just a test.