home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6050 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.0 KB  |  59 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!Sirius.dfn.de!zrz.tu-berlin.de!opal.cs.tu-berlin.de!mauriti
  3. From: mauriti@cs.tu-berlin.de (Frank Hartlep)
  4. Subject: comp.unix.programmer
  5. Message-ID: <KOT6WBG@mailgzrz.tu-berlin.de>
  6. Sender: news@mailgzrz.tu-berlin.de (News Manager)
  7. Nntp-Posting-Host: hivehom.cs.tu-berlin.de
  8. Organization: Technical University of Berlin, Germany
  9. Date: Tue, 8 Sep 1992 14:07:12 GMT
  10. Lines: 47
  11.  
  12. (Excuses if this message appears repeatedly but my newsreader isn't
  13. getting my first two postings.)
  14.  
  15. ... although they do on a NeXT.
  16. Perhaps somebody can see an error in this code.
  17.  
  18.                 .
  19.                 .
  20.                 .
  21.  
  22.         BufferSize += 50000;
  23.         Buffer = malloc (BufferSize);
  24.         Offset = strlen (ARCHIVED) + strlen (Description) + 1 + 4;
  25.         sprintf (Buffer, ARCHIVED "%s", Description);
  26.         xdrmem_create (&Stream, Buffer + Offset, BufferSize - Offset, XDR_ENCODE);
  27.                 .
  28.                 . 
  29.                 .
  30.         (in another function)
  31.         if (Stream->x_op == XDR_ENCODE) {
  32.                 if (*Pointer != NULL) {
  33.                         if (! xdr_bool (Stream, &NonNil))   <=== Bus error
  34.                                 return -1;
  35.                         Next = 0;
  36.                         if (DescriptionLoop (
  37.                                 Stream, Description, Descriptor, Pointer, &Next)
  38.                             == -1)
  39.                                 return -1;
  40.                 }
  41.                 .
  42.                 .
  43.                 .
  44.  
  45. Some more info:
  46. 1.      The xdr_bool does the first write to the XDR stream, so it's very
  47.         probable that something's wrong with the stream.
  48. 2.      The malloc for Buffer was ok, there should be enough memory for
  49.         the stream.
  50. 3.      The Stream and NonNil variables seem to be ok, too.
  51.  
  52. I'm totally clueless. The routines have been heavily used on a NeXT without
  53. any problem, but on a Sun4 (and IPX) they never make it beyond that point.
  54.  
  55. Any ideas are greatly apreciated.
  56.  
  57.  
  58. Frank
  59.