From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 13 06:10:27 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 298B716A4CE for ; Mon, 13 Sep 2004 06:10:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CB2843D3F for ; Mon, 13 Sep 2004 06:10:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8D6ARei020182 for ; Mon, 13 Sep 2004 06:10:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8D6AQN2020172; Mon, 13 Sep 2004 06:10:26 GMT (envelope-from gnats) Date: Mon, 13 Sep 2004 06:10:26 GMT Message-Id: <200409130610.i8D6AQN2020172@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Giorgos Keramidas Subject: Re: bin/71616: [PATCH] cleanup of the usr.sbin/yp_mkdb code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2004 06:10:27 -0000 The following reply was made to PR bin/71616; it has been noted by GNATS. From: Giorgos Keramidas To: Brooks Davis Cc: bug-followup@freebsd.org Subject: Re: bin/71616: [PATCH] cleanup of the usr.sbin/yp_mkdb code Date: Mon, 13 Sep 2004 09:05:27 +0300 On 2004-09-12 16:40, Brooks Davis wrote: > On Sun, Sep 12, 2004 at 08:10:55PM +0000, Giorgos Keramidas wrote: > > On 2004-09-12 04:37, Dan Lukes wrote: > > > *** usr.sbin/yp_mkdb/yp_mkdb.c.ORIG Sun Sep 5 18:54:07 2004 > > > --- usr.sbin/yp_mkdb/yp_mkdb.c Sun Sep 5 19:01:20 2004 > > > [...] > > > - snprintf(buf, sizeof(buf), "%lu", time(NULL)); > > > + snprintf(buf, sizeof(buf), "%lu", (long unsigned int)time(NULL)); > > > > Just a minor comment: An (unsigned long) cast should be fine here. > > Using unsigned here is actually bogus. time_t is a signed type > in FreeBSD. SUSv3 says "time_t and clock_t shall be integer or > real-floating types." In FreeBSD a cast an integer type is safe. > > Either long or intmax_t are decent choices today. Hmmm, true. I had forgotten about negative values of time_t that represent dates before 1970. Thanks :)