Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp628960ybc; Fri, 22 Nov 2019 10:28:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzrsiI5mE1n8BXh7dmoxsvv3f6jn5AQIHcAVHaVXyUFCjOzW9kAMuUOv7gYlgNawU3BuyF9 X-Received: by 2002:a17:906:6b01:: with SMTP id q1mr23476634ejr.162.1574447295773; Fri, 22 Nov 2019 10:28:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574447295; cv=none; d=google.com; s=arc-20160816; b=PUchVPYcE0f7eSRsKdLwcTVvVj+iRyVmzQGnPWUreY3ojoeQQYgtXorcWgGaHZ7B13 b/Rx9lNK9VMoHni/+EsP1mWzVomY/Y99CUOapdgCCpbALTmkPxcnoUEpMC/A78/0NzsE hAfcPaIO08zgOJzzTQRNStJn4JXMMf0xayLaWiDgq8HN3kus1NaxXG/vYuxYVBPHRs7u xElF3CctcsW5c8jRGHq5kvbsY5/WmdxoemyBDsqdp5r5ogk8A2jFb5tL3shXknbTcNS8 7Gh82YYfLT3FBGFyf+L1vG1dh79xg/ZX48sBfBwvnBrTpmcULX5xFDj90RXuMyWtW8Q9 PNbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=311k9Gn3B56DvZ6pMIyoRpfRz4fiBmnOoSpDwheuaRo=; b=mzEfbrQgFrq9T1zOuGathuiIovmkvEVZMb6lrN3nA2Ehko2ZhHnb2rKxYV/+x4RgNB hZJOCqoSUj1V5oYlFW23Skck3XtBgkNLE7yXOg2MN+4B9tEe0gKpoXh5SVmCAHlIvYji SmYWTNgwheSuyglfR27l2mF7rWRSSj4CrVVV9ZvTg1v8wgYEMDcgruZIPRUcPMTioPA7 jSr+XbzKgUry57tLVkIFCyvSVol/LQyHFsnxHZbpI/7e57eNpUJGYu9DD5tVocxllmw3 JARJVA3U2GtUEjmw5u18+n1eA+MkRzq8eSa7AMuocVTHL38sSzDo4jEU93p6wuWK4NXf i+fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="VGvHVt//"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gs14si4579762ejb.347.2019.11.22.10.27.44; Fri, 22 Nov 2019 10:28:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="VGvHVt//"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726739AbfKVS1l (ORCPT + 99 others); Fri, 22 Nov 2019 13:27:41 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:32999 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726638AbfKVS1l (ORCPT ); Fri, 22 Nov 2019 13:27:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574447260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=311k9Gn3B56DvZ6pMIyoRpfRz4fiBmnOoSpDwheuaRo=; b=VGvHVt//Bkk5ikKXec67GVAj8Wq8yGjEyZfKAr5GAq2Vwfw5JA8J4whaGww7k+EfDqZHbD Ee2Ckb13j3H+tSCEz9YLaz65TJz4HLFISWbTRd7eNzf+plY4S4l/zNQbmM/Ko++OOsi/ba uVHL1065zg4AhIZXqHY1tJ3RPSzfwhM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-318-GKBT49_7NeO3wK0o2g76wA-1; Fri, 22 Nov 2019 13:27:37 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F22C10CE7B2; Fri, 22 Nov 2019 18:27:36 +0000 (UTC) Received: from madhat.boston.devel.redhat.com (ovpn-117-36.phx2.redhat.com [10.3.117.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFA7166844; Fri, 22 Nov 2019 18:27:35 +0000 (UTC) Subject: Re: [nfs-utils PATCH 1/1] Switch legacy index() in favour of strchr() To: Petr Vorel , linux-nfs@vger.kernel.org Cc: Frederik Pasch , Gustavo Zacarias References: <20191122163155.6971-1-petr.vorel@gmail.com> From: Steve Dickson Message-ID: <4813e3b8-ee75-d4e2-774e-84734b6b6718@RedHat.com> Date: Fri, 22 Nov 2019 13:27:34 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191122163155.6971-1-petr.vorel@gmail.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: GKBT49_7NeO3wK0o2g76wA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 11/22/19 11:31 AM, Petr Vorel wrote: > From: Frederik Pasch > > [ gustavo: rebased to 1.2.6 ] > Signed-off-by: Gustavo Zacarias > [ pvorel: taken from Buildroot distribution, rebased ] > Reviewed-by: Petr Vorel > Signed-off-by: Petr Vorel > Signed-off-by: Frederik Pasch > --- > support/nfs/nfs_mntent.c | 6 +++--- > utils/mount/error.c | 2 +- > utils/mountd/fsloc.c | 2 +- > 3 files changed, 5 insertions(+), 5 deletions(-) Committed... (tag: nfs-utils-2-4-3-rc2) steved. > > diff --git a/support/nfs/nfs_mntent.c b/support/nfs/nfs_mntent.c > index 05a4c687..25e5944a 100644 > --- a/support/nfs/nfs_mntent.c > +++ b/support/nfs/nfs_mntent.c > @@ -9,7 +9,7 @@ > */ > > #include > -#include /* for index */ > +#include /* for strchr */ > #include /* for isdigit */ > #include /* for umask */ > #include /* for ftruncate */ > @@ -176,7 +176,7 @@ nfs_getmntent (mntFILE *mfp) { > return NULL; > > mfp->mntent_lineno++; > - s = index (buf, '\n'); > + s = strchr (buf, '\n'); > if (s == NULL) { > /* Missing final newline? Otherwise extremely */ > /* long line - assume file was corrupted */ > @@ -184,7 +184,7 @@ nfs_getmntent (mntFILE *mfp) { > fprintf(stderr, _("[mntent]: warning: no final " > "newline at the end of %s\n"), > mfp->mntent_file); > - s = index (buf, 0); > + s = strchr (buf, 0); > } else { > mfp->mntent_errs = 1; > goto err; > diff --git a/utils/mount/error.c b/utils/mount/error.c > index 562f312e..986f0660 100644 > --- a/utils/mount/error.c > +++ b/utils/mount/error.c > @@ -62,7 +62,7 @@ static int rpc_strerror(int spos) > char *tmp; > > if (estr) { > - if ((ptr = index(estr, ':'))) > + if ((ptr = strchr(estr, ':'))) > estr = ++ptr; > > tmp = &errbuf[spos]; > diff --git a/utils/mountd/fsloc.c b/utils/mountd/fsloc.c > index cf42944f..1b869b60 100644 > --- a/utils/mountd/fsloc.c > +++ b/utils/mountd/fsloc.c > @@ -128,7 +128,7 @@ static struct servers *method_list(char *data) > bool v6esc = false; > > xlog(L_NOTICE, "method_list(%s)", data); > - for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++) > + for (ptr--, listsize=1; ptr; ptr=strchr(ptr, ':'), listsize++) > ptr++; > list = malloc(listsize * sizeof(char *)); > copy = strdup(data); >