From owner-freebsd-standards@FreeBSD.ORG Mon Apr 21 05:00:23 2003 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9670A37B401 for ; Mon, 21 Apr 2003 05:00:23 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A84043FAF for ; Mon, 21 Apr 2003 05:00:23 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h3LC0NUp058715 for ; Mon, 21 Apr 2003 05:00:23 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h3LC0NLt058710; Mon, 21 Apr 2003 05:00:23 -0700 (PDT) Date: Mon, 21 Apr 2003 05:00:23 -0700 (PDT) Message-Id: <200304211200.h3LC0NLt058710@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Stefan Farfeleder Subject: Re: standards/51209: [PATCH] add a64l()/l64a/l64a_r functions (obtained from NetBSD) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Stefan Farfeleder List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 12:00:23 -0000 The following reply was made to PR standards/51209; it has been noted by GNATS. From: Stefan Farfeleder To: bug-followup@FreeBSD.org Cc: Subject: Re: standards/51209: [PATCH] add a64l()/l64a/l64a_r functions (obtained from NetBSD) Date: Mon, 21 Apr 2003 13:52:01 +0200 On Mon, Apr 21, 2003 at 02:59:46PM +0400, Sergey A.Osokin wrote: > +int > +l64a_r (long value, char *buffer, int buflen) > +{ > + char *s = buffer; > + int digit; > + unsigned long v = value; ^^^^^^^^^^^^^ Shouldn't this be 'uint32_t'? According to SUSv3: "If the type long contains more than 32 bits, only the low-order 32 bits shall be used for these operations." > + > + _DIAGASSERT(buffer != NULL); > + > + if (value == 0UL) > + goto out; > + > + for (; v != 0 && buflen > 1; s++, buflen--) { > + digit = (int)(v & 0x3f); > + > + if (digit < 2) > + *s = digit + '.'; > + else if (digit < 12) > + *s = digit + '0' - 2; > + else if (digit < 38) > + *s = digit + 'A' - 12; > + else > + *s = digit + 'a' - 38; > + v >>= 6; > + } > + > +out: > + *s = '\0'; > + > + return (v == 0UL ? 0 : -1); > +}