From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 06:40:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C90481065688; Wed, 5 Nov 2008 06:40:53 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7C288FC12; Wed, 5 Nov 2008 06:40:53 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA56er6a018746; Wed, 5 Nov 2008 06:40:53 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA56erap018745; Wed, 5 Nov 2008 06:40:53 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200811050640.mA56erap018745@svn.freebsd.org> From: Tim Kientzle Date: Wed, 5 Nov 2008 06:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184669 - head/usr.bin/tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 06:40:53 -0000 Author: kientzle Date: Wed Nov 5 06:40:53 2008 New Revision: 184669 URL: http://svn.freebsd.org/changeset/base/184669 Log: When comparing, cast to the larger size, off_t in this case. Once we know which one is smaller, then we cast to the smaller size. Thanks to Xin Li (delphij@) Pointy hat: /me Modified: head/usr.bin/tar/test/main.c Modified: head/usr.bin/tar/test/main.c ============================================================================== --- head/usr.bin/tar/test/main.c Wed Nov 5 05:26:11 2008 (r184668) +++ head/usr.bin/tar/test/main.c Wed Nov 5 06:40:53 2008 (r184669) @@ -494,7 +494,7 @@ test_assert_empty_file(const char *f1fmt if (fd < 0) { fprintf(stderr, " Unable to open %s\n", f1); } else { - s = (sizeof(buff) < (size_t)st.st_size) ? + s = ((off_t)sizeof(buff) < st.st_size) ? (ssize_t)sizeof(buff) : (ssize_t)st.st_size; s = read(fd, buff, s); hexdump(buff, NULL, s, 0);