Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Nov 2005 01:50:42 -0800
From:      Colin Percival <cperciva@freebsd.org>
To:        Greg 'groggy' Lehey <grog@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/portsnap/make_index make_index.c
Message-ID:  <438046F2.60003@freebsd.org>
In-Reply-To: <20051120080850.GD856@eucla.lemis.com>
References:  <200511200050.jAK0oUbB059874@repoman.freebsd.org> <20051120080850.GD856@eucla.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Greg 'groggy' Lehey wrote:
> On Sunday, 20 November 2005 at  0:50:30 +0000, Colin Percival wrote:
>>  Log:
>>  An empty file does not have a positive number of lines.
> 
> Yes it does.  It's 0, not -0.

As a mathematician, I must insist that 0 = -0 and is neither
positive nor negative. :-)

>>  Make sure that the number of lines read is non-zero before in
>>  order to avoid dumping core.
> 
> This is a different (and presumably correct) test.

The correct test is actually to verify that the number of lines
is positive, but while we cannot assume this (as I originally
did), we can assume that the number of lines is non-negative
(and all non-negative non-zero values are positive).

Colin Percival



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?438046F2.60003>