[net.bugs.2bsd] Last problem -- int vs. long

goldberg@uiucdcs.CS.UIUC.EDU (02/21/86)

Date: Thu, 20 Feb 86 10:53:16 cst
From: stevea@uiphysed.PE.UIUC.EDU (Steve Alexander)
To: goldberg@a.cs.uiuc.edu
Subject: bug report, please post to bugs.2bsd

Subject: Last won't work with more than 128 utmp records
Index:	ucb/last.c 2.9bsd (Harvard/CSS) Fix

Description:
	Last was moved from a VAX where sizeof(int) == sizeof(long).  This
	breaks on a PDP-11, because lseek is being called with a 16-bit
	offset.

Repeat-By:
	Wait for your /usr/adm/wtmp file to grow larger than 4608 bytes,
	which is 128 struct utmps.
	Run last, noticing that it does not reflect current system status.
	Flame about Berkeley, and their aversion to lint.
Fix:
	In last.c, routine main, in the lseek call, cast the expression
	(bl * sizeof(buf)) to a long.  Flame some more.