home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d0xx / d050 / unixarc.lha / UnixArc / bugs / unixarc.56 < prev    next >
Encoding:
Text File  |  1987-01-17  |  1.2 KB  |  40 lines

  1. Article 56 of net.sources.bugs:
  2. Path: mcdsun!noao!hao!nbires!seismo!rutgers!princeton!allegra!ulysses!mhuxt!ihnp4!houxm!hjuxa!catnip!ben
  3. From: ben@catnip.UUCP
  4. Newsgroups: net.sources.bugs
  5. Subject: Fix to make Unix arc work on 16 bit machines
  6. Message-ID: <438@catnip.UUCP>
  7. Date: 25 Dec 86 06:15:15 GMT
  8. Organization: The Broder Residence, Holmdel, NJ  07733
  9. Lines: 27
  10.  
  11. There is a bug in the recently distributed Unix ARC that will cause
  12. it to fail when extracting long files, in partcular, files whose
  13. size cannot be expressed as a 16 bit quantity.
  14.  
  15. The problem is in the dos2long conversion in arcunix.c.
  16.  
  17. The offending code as it originally appears
  18.  
  19. #define dos2long(x) ((unsigned char)(x)[0] + ((unsigned char)(x)[1]<<8) + \
  20.         ((unsigned char)(x)[2]<<16) + \ ((unsigned char)(x)[3]<<24))
  21.  
  22.  
  23. will shift (x)[2] and (x)[3] straight into the bit bucket.  I just casted
  24. them to long to rectify the problem.
  25.  
  26. #define dos2long(x) ((unsigned char)(x)[0] + ((unsigned char)(x)[1]<<8) + \
  27.         ((long)(unsigned char)(x)[2]<<16) + \
  28.                 ((long)(unsigned char)(x)[3]<<24))
  29.  
  30. ----
  31. arc now appears to run fine under SCO Xenix.
  32.  
  33. -- 
  34.  
  35. Ben Broder
  36. {ihnp4,decvax} !hjuxa!catnip!ben
  37. {houxm,clyde}/
  38.  
  39.  
  40.