From owner-svn-ports-all@freebsd.org Mon Oct 9 17:34:08 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3798AE3755B; Mon, 9 Oct 2017 17:34:08 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D854473CFF; Mon, 9 Oct 2017 17:34:07 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 1bwKeAX5CI8mC1bwLeqzLM; Mon, 09 Oct 2017 11:34:06 -0600 X-Authority-Analysis: v=2.2 cv=HahkdmM8 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=hG0NqlmlVPZBtqtVtKsA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E07F4239; Mon, 9 Oct 2017 10:34:03 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v99HY3YM011289; Mon, 9 Oct 2017 10:34:03 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710091734.v99HY3YM011289@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Alexey Dokuchaev cc: Cy Schubert , ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: Re: svn commit: r451623 - in head/net/tcpview: . files In-Reply-To: Message from Alexey Dokuchaev of "Mon, 09 Oct 2017 17:07:19 -0000." <20171009170719.GA89682@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 09 Oct 2017 10:34:03 -0700 X-CMAE-Envelope: MS4wfBnoHeMo/EvzxdKLu2r8EXgVYhRb9aHfpb+wzqvrQIHDhaBXlYukd3USmV8Zax/ELmWuHbHrZruUQO54xVgHXu8F7RnAGQnds0AmKgDnph6t0CAJFruL XuVKuWJlRJV/L7rZBFM9ii7OyriPq4rRMSxroINkD/GGJHsXMFyul4LqQtzzrZUsS+g1LQsH67+BRk9WulqiAMpYs5lpaI4+iyijPqn2FA9Hvqakf+5YOqsc l9gU9MWcOfFsYFNJo77cF5iHEVzx/GuO0X63Ry584mgTzNnB2Ms3uj8IuEpjA1z5nV+eGs8+YOO/dh3/TbPk2A== X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 17:34:08 -0000 In message <20171009170719.GA89682@FreeBSD.org>, Alexey Dokuchaev writes: > On Mon, Oct 09, 2017 at 04:58:45PM +0000, Cy Schubert wrote: > > New Revision: 451623 > > URL: https://svnweb.freebsd.org/changeset/ports/451623 > > > > Log: > > Use fgets() instead of gets(). > > > > The approach I used was to create a "poor man's" gets macro as an example > . > > Though not the same as gets() it approximates gets() well enough. We migh > t > > want to consider this approach in base. > > I don't think I understand this comment, really. Rather than replace gets() with fgets() directly I had a little fun with it and created a macro, with the added benefit that maybe someone might want to consider something like this to replace gets() when that happens. It's not the same as gets() but close enough. > > > Added: head/net/tcpview/files/patch-hex.c > > @@ -0,0 +1,10 @@ > > +--- hex.c.orig 1993-04-22 13:40:04.000000000 -0700 > > ++++ hex.c 2017-10-06 07:25:01.182767000 -0700 > > +@@ -85,6 +85,7 @@ > > + char *s; > > + > > + do { > > ++#define gets(a) fgets(a,sizeof(a),stdin) > > + if( gets(str) == NULL ) > > gets(3) called only once in this port; why not simply patch that single > call properly instead of bringing in a "poor man's" macro? As an example. To open discussion of possibilities. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.