From owner-svn-src-user@FreeBSD.ORG Tue Sep 14 07:09:25 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 068C2106566C; Tue, 14 Sep 2010 07:09:25 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EABCF8FC13; Tue, 14 Sep 2010 07:09:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E79OPc071332; Tue, 14 Sep 2010 07:09:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E79OJC071330; Tue, 14 Sep 2010 07:09:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201009140709.o8E79OJC071330@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 14 Sep 2010 07:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212602 - user/des/phybs X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 07:09:25 -0000 Author: des Date: Tue Sep 14 07:09:24 2010 New Revision: 212602 URL: http://svn.freebsd.org/changeset/base/212602 Log: Fix an overflow in the tps calculation. Noticed by: Pieter de Goeje Modified: user/des/phybs/phybs.c Modified: user/des/phybs/phybs.c ============================================================================== --- user/des/phybs/phybs.c Tue Sep 14 04:57:30 2010 (r212601) +++ user/des/phybs/phybs.c Tue Sep 14 07:09:24 2010 (r212602) @@ -36,8 +36,9 @@ #include #include #include -#include +#include #include +#include #include #include @@ -101,9 +102,9 @@ scan(int fd, size_t size, off_t offset, err(1, "gettimeofday()"); usec = t1.tv_sec * 1000000 + t1.tv_usec; usec -= t0.tv_sec * 1000000 + t0.tv_usec; - printf("%10lu%8lu%8lu\n", usec / 1000, - count * 1000000 / usec, - count * size * 1000000 / 1024 / usec); + printf("%10lu%8ju%8ju\n", usec / 1000, + (uintmax_t)count * 1000000 / usec, + (uintmax_t)count * size * 1000000 / 1024 / usec); free(buf); }