Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Nov 2008 06:40:53 +0000 (UTC)
From:      Tim Kientzle <kientzle@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184669 - head/usr.bin/tar/test
Message-ID:  <200811050640.mA56erap018745@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811050640.mA56erap018745>