home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / amiga / programm / 11815 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.4 KB

  1. Path: sparky!uunet!cbmvax!cbmehq!cbmger!peterk
  2. From: peterk@cbmger.de.so.commodore.com (Dr Peter Kittel Germany)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Printing the device list -- what am I doing wrong?
  5. Message-ID: <9455@cbmger.de.so.commodore.com>
  6. Date: 29 Jul 92 15:08:44 GMT
  7. References: <51071@dime.cs.umass.edu>
  8. Reply-To: peterk@cbmger.de.so.commodore.com (Dr Peter Kittel Germany)
  9. Organization: Commodore Germany
  10. Lines: 27
  11.  
  12. In article <51071@dime.cs.umass.edu> barrett@gleep.cs.umass.edu (Daniel Barrett) writes:
  13.  >
  14.  >    I'm trying to print the list of volumes under 2.04.  The following
  15.  >program gives me a recoverable alert 01000008.  What am I doing wrong?
  16.  
  17. Try to handle the strings as BSTR! Take the first byte as length and then
  18. only copy so many bytes to output. You can't rely on null terminated
  19. strings here, as you do implicitly when using standard C routines.
  20.  
  21.  >    The device names DO get printed, but they appear with extra
  22.  >spaces in front of them, or backspace characters.  Weird.
  23.  
  24. I guess these are the length bytes :-)
  25.  
  26.  >        name = BADDR(dlist->dol_Name);
  27.  >
  28.  >        if (name)
  29.  >        {
  30.  >            FPuts(Output(), name);
  31.  
  32. This is the bug. First fetch the first byte as length and then fetch these
  33. n bytes.
  34.  
  35. -- 
  36. Best regards, Dr. Peter Kittel  // E-Mail to \\  Only my personal opinions...
  37. Commodore Frankfurt, Germany  \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk
  38.                    or  peterk@public.sub.org
  39.