From 68962748a62c84f65a1ae9237ef08348c6f49f6a Mon Sep 17 00:00:00 2001 From: bde Date: Wed, 30 Apr 1997 17:51:29 +0000 Subject: Fixed overflow for attempts to seek to offsets > ULONG_MAX. See the OpenBSD version for more complete fixes. E.g., to seek to offsets > INT_MAX using a block size of 1, block numbers need to be off_t's instead of u_long's. --- bin/dd/position.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/dd') diff --git a/bin/dd/position.c b/bin/dd/position.c index 9c5616d..9e2ed77 100644 --- a/bin/dd/position.c +++ b/bin/dd/position.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: position.c,v 1.5 1997/02/22 14:02:48 peter Exp $ */ #ifndef lint @@ -67,7 +67,7 @@ pos_in() /* If not a character, pipe or tape device, try to seek on it. */ if (!(in.flags & (ISCHR|ISPIPE|ISTAPE))) { - if (lseek(in.fd, (off_t)(in.offset * in.dbsz), SEEK_CUR) == -1) + if (lseek(in.fd, (off_t)in.offset * in.dbsz, SEEK_CUR) == -1) err(1, "%s", in.name); return; } -- cgit v1.1