From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25030 invoked by alias); 10 Sep 2014 17:34:54 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 25019 invoked by uid 89); 10 Sep 2014 17:34:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Message-ID: <54108BB0.90902@redhat.com> Date: Wed, 10 Sep 2014 17:34:00 -0000 From: Florian Weimer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Wilco Dijkstra , azanella@linux.vnet.ibm.com CC: libc-alpha@sourceware.org Subject: Re: [PATCH] Improve performance of strncpy References: <001301cfcd0a$f0b62670$d2227350$@com> In-Reply-To: <001301cfcd0a$f0b62670$d2227350$@com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00192.txt.bz2 On 09/10/2014 05:21 PM, Wilco Dijkstra wrote: > Yes, you're right, I timed it and there is actually little difference, while > the code is now even simpler. New version below (not attaching results in bad > characters due to various mail servers changing line endings). > > OK for commit? I think you could simplify it down to strnlen, memcpy, and memset. -- Florian Weimer / Red Hat Product Security