From owner-freebsd-bugs@FreeBSD.ORG Thu Oct 30 08:00:37 2003 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 3E77016A4CF for ; Thu, 30 Oct 2003 08:00:37 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9EA743FB1 for ; Thu, 30 Oct 2003 08:00:35 -0800 (PST) (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 h9UG0ZFY090472 for ; Thu, 30 Oct 2003 08:00:35 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h9UG0ZsR090471; Thu, 30 Oct 2003 08:00:35 -0800 (PST) (envelope-from gnats) Resent-Date: Thu, 30 Oct 2003 08:00:35 -0800 (PST) Resent-Message-Id: <200310301600.h9UG0ZsR090471@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, pak@cns.utoronto.ca Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57B0916A4CE for ; Thu, 30 Oct 2003 07:57:49 -0800 (PST) Received: from rodent.utcs.utoronto.ca (rodent.utcs.utoronto.ca [128.100.102.5]) by mx1.FreeBSD.org (Postfix) with SMTP id 72C4643F85 for ; Thu, 30 Oct 2003 07:57:48 -0800 (PST) (envelope-from pkern@cns.utoronto.ca) Received: by rodent.utcs.utoronto.ca id <1648401>; Thu, 30 Oct 2003 10:57:38 -0500 Message-Id: <03Oct30.105738est.1648401@rodent.utcs.utoronto.ca> Date: Thu, 30 Oct 2003 10:57:38 -0500 From: pak@cns.utoronto.ca To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: pak@cns.utoronto.ca Subject: bin/58730: [patch] "fortune -l ..." loops forever. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: pak@cns.utoronto.ca List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2003 16:00:37 -0000 >Number: 58730 >Category: bin >Synopsis: [patch] "fortune -l ..." loops forever. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Oct 30 08:00:35 PST 2003 >Closed-Date: >Last-Modified: >Originator: pak >Release: FreeBSD 4.9-RELEASE i386 >Organization: U of Toronto Computing and Networking Services >Environment: System: FreeBSD work 4.9-RELEASE FreeBSD 4.9-RELEASE #1: Wed Oct 29 13:17:28 EST 2003 root@:/usr/src/sys/compile/WORK i386 >Description: "fortune -l ..." loops forever. fortlen() in fortune.c was only ever returning 0 or 1 instead of the actual length of a fortune. >How-To-Repeat: % fortune -l >Fix: *** usr/src/games/fortune/fortune/fortune.c 2003/10/30 15:39:08 1.1 --- usr/src/games/fortune/fortune/fortune.c 2003/10/30 15:39:43 *************** *** 282,288 **** char line[BUFSIZ]; if (!(Fortfile->tbl.str_flags & (STR_RANDOM | STR_ORDERED))) ! nchar = (Seekpts[1] - Seekpts[0] <= SLEN); else { open_fp(Fortfile); (void) fseek(Fortfile->inf, Seekpts[0], 0); --- 282,288 ---- char line[BUFSIZ]; if (!(Fortfile->tbl.str_flags & (STR_RANDOM | STR_ORDERED))) ! nchar = Seekpts[1] - Seekpts[0]; else { open_fp(Fortfile); (void) fseek(Fortfile->inf, Seekpts[0], 0); >Release-Note: >Audit-Trail: >Unformatted: