From owner-freebsd-audit Sun Jun 3 10:56:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 1B5B737B407 for ; Sun, 3 Jun 2001 10:56:39 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f53HuaS34974; Sun, 3 Jun 2001 13:56:36 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20010530032324.6D5A13E0B@bazooka.unixfreak.org> References: <20010530032324.6D5A13E0B@bazooka.unixfreak.org> Date: Sun, 3 Jun 2001 13:56:33 -0400 To: Dima Dorfman , audit@FreeBSD.ORG From: Garance A Drosihn Subject: Re: last(1) WARNS patch for review Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 8:23 PM -0700 5/29/01, Dima Dorfman wrote: >Please review the attached patch to last(1) which silences >most of the warnings. I'm particuarly doubtful about the >printf formatting changes. They seem to be correct, but >there might've been a reason why they were originally >written incorrectly (a reason other than not compiling >with the right -W flags). There are a number of hairy issues when going to print out a time_t. See my recent message to -arch, where I quoted most of Garrett Wollman's recent message to -stable. In short: A time_t can be integral, floating-point, or complex. It can be signed or unsigned. It can be "regular size" or "long". When it comes to printing, Garrett mentioned: There is a simple way around this, for POSIX systems only: use strftime() with the %s format. which I assume means that freebsd has %s in strftime. If so, then maybe the wisest change for 'last' would be to call strftime() to get the right string. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message