[comp.sys.mac] mcvert, CRC errors on Sun???

caesar@otis.DAB.GE.COM (11/22/89)

I am trying to use mcvert on my Sun to unbinhex files received
from comp.binaries.mac so they can be through TOPS to a Mac
then unstuffed with the Unstuffit DA.  I know StuffIt 1.5.1
has an unbinhex option, but I'd prefer to do this step on
my Sun if possible.

When I run mcvert I invariably receive a CRC error.  I noticed
that if I added an extra line to hqxify.c's hqx_to_bin_hdr:

   :
 calc_crc = 0;
 while (hqx_ptr < hqx_end)
     calc_crc = (((calc_crc&0xff) << 8) | *hqx_ptr++) ^ magic[calc_crc >> 8];
 calc_crc = ((calc_crc&0xff) << 8) ^ magic[calc_crc >> 8];
 calc_crc = ((calc_crc&0xff) << 8) ^ magic[calc_crc >> 8];
 buf_ptr = hqx_ptr;
 calc_crc |= *(buf_ptr + 1); /* <<<<<< I added this line <<<<<< */
   :
 check_hqx_crc(calc_crc, "File header CRC mismatch in %s", binfname);
   :

then the I would no longer get CRC errors any file headers. But
I cannot find a simple solution to the "file data" or "file rsrc"
CRC errors.  I've seen the .hqx file processed correctly with
StuffIt 1.5.1 and mcvert starts by saying:

   Converting     SafeEject.sit    type = "SIT!", author = "SIT!"

so the .hqx files seem to be good.  I do not know the algorithm for
binhex, so I am pretty well lost (them thar magic numbers must be
doin' sumtin' pretty sneaky :^)  ). Is the problem with mcvert,
byte order on the Sun, NL instead of CR, phase of the moon ...

Has anyone else had errors like this?  Please e-mail me anything
that might help or a note for me to e-mail the solution to you
when I get this problem resolved.  Thanks.

Bob

--
Robert J. Caesar Jr. <caesar@ge-dab.ge.com>  General Electric Company
UUCP: ...!mcnc!ge-rtp!ge-dab!caesar       Simulation & Control Systems Dept.
PHONE: (904) 239-2011                     1800 Volusia Avenue, Room 4150
GECOM:     8*620-2011                     Daytona Beach, Florida  32015