Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Oct 2003 10:57:38 -0500
From:      pak@cns.utoronto.ca
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        pak@cns.utoronto.ca
Subject:   bin/58730: [patch] "fortune -l ..." loops forever.
Message-ID:  <03Oct30.105738est.1648401@rodent.utcs.utoronto.ca>
Resent-Message-ID: <200310301600.h9UG0ZsR090471@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?03Oct30.105738est.1648401>