🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #727

DWB troff font bug

#727
From: Doug Gwyn
Date: Wed, 16 Mar 1988 12:46
29 lines
1217 bytes
When we expanded troff to support more fonts, a horrible bug surfaced.
When the device had more than 18 fonts, font 'B' got mapped to the
wrong font position!  This bug appears in both DWB 1.0 and DWB 2.0
versions of device-independent troff, in source file t6.c (normally
found in a source directory named "troff.d").  The faulty function
"findft" is identical in both DWB releases.  Here's the fixed function:

findft(i)
register int	i;
{
#if 0	/* DAG -- horrible bug! */
	register k;

	if ((k = i - '0') >= 0 && k <= nfonts && k < smnt)
#else
	register int k, m;

	if (i >= '0' && i <= '9'
	 && (k = i - '0') <= nfonts && k < smnt
	 || (k = (i & 0xFF00) >> 8) >= '0' && k <= '9'
	 && (m = i & 0xFF) >= '0' && m <= '9'
	 && (k = m - '0' + 10 * (k - '0')) <= nfonts && k < smnt)
#endif
		return(k);
	for (k = 0; fontlab[k] != i; k++)
		if (k > nfonts)
			return(-1);
	return(k);
}
Technical Details
Message-ID: <12427@brl-adm.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!yale!cmcl2!brl-adm!gwyn

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!yale!cmcl2!brl-adm!gwyn
From: gwyn@brl-adm.ARPA (Doug Gwyn )
Newsgroups: comp.bugs.sys5
Subject: DWB troff font bug
Message-ID: <12427@brl-adm.ARPA>
Date: 16 Mar 88 12:46:34 GMT
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 29
Keywords: DWB troff font bug