NetBSD Problem Report #18823

Received: (qmail 10225 invoked by uid 605); 27 Oct 2002 03:31:38 -0000
Message-Id: <200210270331.g9R3VZX11387@fsrv.plectere.com>
Date: Sat, 26 Oct 2002 20:31:35 -0700 (PDT)
From: Paul Shupak <paul@fsrv.plectere.com>
Sender: gnats-bugs-owner@netbsd.org
Reply-To: paul@fsrv.plectere.com
To: gnats-bugs@gnats.netbsd.org
Subject: systat io/numbers micalculates how many drives per row
X-Send-Pr-Version: 3.95

>Number:         18823
>Category:       bin
>Synopsis:       systat io/numbers micalculates how many drives per row
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 27 03:32:00 +0000 2002
>Closed-Date:    Tue Aug 12 17:17:36 +0000 2003
>Last-Modified:  Tue Aug 12 17:17:36 +0000 2003
>Originator:     Paul Shupak
>Release:        NetBSD 1.6J - today
>Organization:
>Environment:
System: NetBSD fsrv 1.6J NetBSD 1.6J (FSRV) #264: Sat Oct 26 17:03:28 PDT 2002 root@fsrv:/usr/src/sys/arch/i386/compile/FSRV i386
Architecture: i386
Machine: i386
>Description:
	The corner if the window is (0,0) based which gives us the "+1"
	instead of a "-1" AND we don't need a trailing space for the last
	column giving us "+2"
	e.g. if ( getmaxx(wnd) == 79 ) then wnd is 80 characters wide.
>How-To-Repeat:
	% systat io
	:number

	Test with at least three disks and window widths of 41, 42, and 43
	characters at least 20 lines ( xterm makes this easy to see ).
>Fix:
Index: iostat.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/systat/iostat.c,v
retrieving revision 1.22
diff -c -r1.22 iostat.c
*** iostat.c	2002/09/25 13:50:39	1.22
--- iostat.c	2002/10/27 03:28:37
***************
*** 129,135 ****
  	int i, col, regions, ndrives;

  #define COLWIDTH	14
! #define DRIVESPERLINE	((getmaxx(wnd) - 1) / COLWIDTH)
  	for (ndrives = 0, i = 0; i < dk_ndrive; i++)
  		if (cur.dk_select[i])
  			ndrives++;
--- 129,135 ----
  	int i, col, regions, ndrives;

  #define COLWIDTH	14
! #define DRIVESPERLINE	((getmaxx(wnd) + 2) / COLWIDTH)
  	for (ndrives = 0, i = 0; i < dk_ndrive; i++)
  		if (cur.dk_select[i])
  			ndrives++;
***************
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dsl 
State-Changed-When: Tue Aug 12 17:17:02 UTC 2003 
State-Changed-Why:  
Fixed by rev 1.29 of systat/iostat.c (fix in PR is incorrect) 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.