From cf0ad320e41653772a3d2b018a8cd8ac60751e82 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 2 Jul 1998 05:12:53 +0000 Subject: [PATCH] o fix bug in conversion of DOS 32-bit signed number to FreeBSD's 64-bit off_t. This fixed the primitive 'copy protection' that the program I'm using. --- usr.bin/doscmd/dos.c | 4 ++-- usr.bin/doscmd/intff.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/doscmd/dos.c b/usr.bin/doscmd/dos.c index 88d2b70edcb1..7d79c2faabac 100644 --- a/usr.bin/doscmd/dos.c +++ b/usr.bin/doscmd/dos.c @@ -31,7 +31,7 @@ * * BSDI int21.c,v 2.2 1996/04/08 19:32:51 bostic Exp * - * $Id: dos.c,v 1.1 1997/08/09 01:42:40 dyson Exp $ + * $Id: dos.c,v 1.2 1998/07/01 19:56:13 imp Exp $ */ #include "doscmd.h" @@ -1345,7 +1345,7 @@ int21_42(regcontext_t *REGS) int whence; off_t offset; - offset = ((off_t)R_CX << 16) + R_DX; + offset = (off_t) ((int) (R_CX << 16) + R_DX); switch (R_AL) { case 0: whence = SEEK_SET; diff --git a/usr.bin/doscmd/intff.c b/usr.bin/doscmd/intff.c index 5035a1ff5859..ae86ac526d11 100644 --- a/usr.bin/doscmd/intff.c +++ b/usr.bin/doscmd/intff.c @@ -29,7 +29,7 @@ * * BSDI intff.c,v 2.2 1996/04/08 19:32:56 bostic Exp * - * $Id: intff.c,v 1.2 1997/09/30 22:03:57 jlemon Exp $ + * $Id: intff.c,v 1.3 1998/07/01 19:56:17 imp Exp $ */ #include "doscmd.h" @@ -450,7 +450,7 @@ int2f11_lseek(regcontext_t *REGS) off_t offset; fd = r_sft->fd; - offset = (R_CX << 16) + R_DX; + offset = (off_t) ((int) ((R_CX << 16) + R_DX); debug(D_REDIR,"lseek(%d, 0x%qx, SEEK_END)\n", fd, offset);