From owner-freebsd-alpha Thu Nov 8 12:20:20 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E63D837B417 for ; Thu, 8 Nov 2001 12:20:03 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fA8KK3v63030; Thu, 8 Nov 2001 12:20:03 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7A85E37B416 for ; Thu, 8 Nov 2001 12:19:47 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fA8KJlJ63001; Thu, 8 Nov 2001 12:19:47 -0800 (PST) (envelope-from nobody) Message-Id: <200111082019.fA8KJlJ63001@freefall.freebsd.org> Date: Thu, 8 Nov 2001 12:19:47 -0800 (PST) From: Paul Herman To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: alpha/31859: jot(1) broken on alpha Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31859 >Category: alpha >Synopsis: jot(1) broken on alpha >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-alpha >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 08 12:20:03 PST 2001 >Closed-Date: >Last-Modified: >Originator: Paul Herman >Release: 4.3-RELEASE >Organization: >Environment: FreeBSD tick.sc.omation.com 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Thu Aug 23 09:00:51 PDT 2001 pherman@tick.sc.omation.com:/usr/src/sys/compile/tick alpha >Description: jot -r is broken on alpha, and most likely other 64-bit platforms. This is becuase jot assumes that arc4random() outputs a long rather than int. >How-To-Repeat: 12:14:43{{ttyq6}pherman@tick}/usr/src/usr.bin/jot//> jot -r 5 1 1 1 1 1 >Fix: Manpage for arc4random() specifies a u_int32 as output, and NOT a u_long. Patch against 4.4-RELEASE: Index: jot.c =================================================================== RCS file: /home/ncvs/src/usr.bin/jot/jot.c,v retrieving revision 1.13.2.2 diff -u -r1.13.2.2 jot.c --- jot.c 2001/07/19 07:57:42 1.13.2.2 +++ jot.c 2001/11/08 20:07:38 @@ -277,7 +277,7 @@ if (randomize) { *x = (ender - begin) * (ender > begin ? 1 : -1); for (*i = 1; *i <= reps || infinity; (*i)++) { - *y = arc4random() / (double)ULONG_MAX; + *y = arc4random() / (double)UINT_MAX; if (putdata(*y * *x + begin, reps - *i)) errx(1, "range error in conversion"); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message