From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33275 invoked by alias); 30 Aug 2017 14:59:09 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 33227 invoked by uid 89); 30 Aug 2017 14:59:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail01.lgsinnovations.com Received: from mail01.lgsinnovations.com (HELO mail01.lgsinnovations.com) (184.75.234.233) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Aug 2017 14:59:07 +0000 Subject: Re: [PATCH v2] Modify strnstr.c. To: References: <1504062237-19638-1-git-send-email-1473996754@qq.com> From: Craig Howland Message-ID: <59e649fe-3517-f182-3281-f07ca24b1bfb@LGSInnovations.com> Date: Wed, 30 Aug 2017 15:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <1504062237-19638-1-git-send-email-1473996754@qq.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LGS-EX05.lgsdirect.com (135.22.48.227) To LGS-EX01.lgsdirect.com (135.22.77.164) X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00920.txt.bz2 On 08/29/2017 11:03 PM, Sichen Zhao wrote: > char * > -strnstr(const char *s, const char *find, size_t slen) > +strnstr(const char *haystack, const char *needle, size_t haystack_len) > This change to the function prototype makes it mismatch the preceding comment which summarizes the function: /* * Find the first occurrence of find in s, where the search is limited to the * first slen characters of s. */ While it obviously works either way, the former names are the more common way to refer to these things, so while the comment can obviously be changed to match the prototype, keeping the original names seems more appropriate. Craig