home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / uclkermit / cuclker.bwr next >
Internet Message Format  |  1991-10-22  |  3KB

  1. Date: Fri, 18 Oct 91 11:48:11 edt
  2. From: John Ball <jball@sleepy.haystack.edu>
  3. To: kermit@watsun.cc.columbia.edu
  4. Subject: Problem with UCL Kermit 
  5. Cc: cjk%cs.ucl.ac.uk.bitnet@cunyvm.cuny.edu,
  6.         info-kermit%cs.ucl.ac.uk.bitnet@cunyvm.cuny.edu,
  7.         kad@fourier.haystack.edu, mike@wells.haystack.edu,
  8.         syskermit%vax1.lancs.ac.uk.bitnet@cunyvm.cuny.edu
  9.  
  10.      This is a note about a problem in and a fix for UCL
  11. (University College London) Kermit in files cuclker.c and cuclx5.c
  12. (for Unix System 5) in the kermit/d subdirectory on
  13. watsun.cc.columbia.edu.  UCL Kermit is a "trim" version of Kermit
  14. for Unix and was officially released by Columbia some years ago. 
  15. We at Haystack have just begun using it on a 386-based PC with Esix
  16. Unix System V.3.2 but only after making the fix described below.
  17.  
  18.      The problem involves signed char variables.  If your C
  19. compiler takes chars to be signed, then you'll have the following
  20. problem (and perhaps others that we haven't found) when
  21. transferring binary files.  The symptom (well, one of the symptoms)
  22. is that an extra block of some 50 to 80 bytes gets inserted into
  23. sent binary files whenever the following block begins with FE
  24. (hex).  The extra block is approximately a repeat of the block
  25. preceding the one beginning FE.  The problem arises in bufill() and
  26. encode(), which use oldt = -2 (an impossible last char, according
  27. to the associated comment) to tell encode() that the repeat
  28. mechanism should start afresh.  Now -2 as a int is, indeed, an
  29. impossible char, but FE (hex) as a signed char is just -2, and
  30. that's what it becomes after being processed through ascedit(),
  31. which is type char.
  32.  
  33.      Probably the best fix is to persuade your C compiler to treat
  34. all chars as unsigned.  Some C compilers can do this if asked, and
  35. some C compilers do it without being asked.  Presumably this is why
  36. the folks at UCL didn't have this problem.  An alternative fix is
  37. to change oldt = -2 (in bufill() and in encode()) to a number, say
  38. -2000, that is an impossible char regardless of sign.  This leaves
  39. the possibility of some other yet-undiscovered still-more-subtle
  40. problem.  A third alternative is to edit the files to change some
  41. or all of the char functions to unsigned char.  We think that int
  42. would also work.  You'll need to change each function in at least
  43. two places, one in each of the two *.c files.
  44.  
  45.      We suggest that a copy of this note should accompany the UCL
  46. Kermit distribution perhaps in cuclker.hlp.
  47.  
  48. John Ball  (jball@wells.haystack.edu)             1991 October 18
  49. M.I.T. Haystack Observatory
  50. Off Route 40 
  51. Westford, Massachusetts  01886  U.S.A. 
  52.