Article View: net.sources.bugs
Article #881Fix to make Unix arc work on 16 bit machines
From: ben
Date: Thu, 25 Dec 1986 06:15
Date: Thu, 25 Dec 1986 06:15
27 lines
1344 bytes
1344 bytes
There is a bug in the recently distributed Unix ARC that will cause
it to fail when extracting long files, in partcular, files whose
size cannot be expressed as a 16 bit quantity.
The problem is in the dos2long conversion in arcunix.c.
The offending code as it originally appears
#define dos2long(x) ((unsigned char)(x)[0] + ((unsigned char)(x)[1]<<8) + \
((unsigned char)(x)[2]<<16) + \ ((unsigned char)(x)[3]<<24))
will shift (x)[2] and (x)[3] straight into the bit bucket. I just casted
them to long to rectify the problem.
#define dos2long(x) ((unsigned char)(x)[0] + ((unsigned char)(x)[1]<<8) + \
((long)(unsigned char)(x)[2]<<16) + \
((long)(unsigned char)(x)[3]<<24))
----
arc now appears to run fine under SCO Xenix.
--
Ben Broder
{ihnp4,decvax} !hjuxa!catnip!ben
{houxm,clyde}/
Technical Details
Message-ID:
<438@catnip.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!princeton!allegra!ulysses!mhuxt!ihnp4!houxm!hjuxa!catnip!benShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!princeton!allegra!ulysses!mhuxt!ihnp4!houxm!hjuxa!catnip!ben From: ben@catnip.UUCP Newsgroups: net.sources.bugs Subject: Fix to make Unix arc work on 16 bit machines Message-ID: <438@catnip.UUCP> Date: Thu, 25-Dec-86 01:15:15 EST Article-I.D.: catnip.438 Posted: Thu Dec 25 01:15:15 1986 Date-Received: Thu, 25-Dec-86 22:42:53 EST Organization: The Broder Residence, Holmdel, NJ 07733 Lines: 27