Fix to make Unix arc work on 16 bit machines
ben at catnip.UUCP
ben at catnip.UUCP
Thu Dec 25 16:15:15 AEST 1986
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}/
More information about the Comp.sources.bugs
mailing list