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

  1. Path: sparky!uunet!gatech!rutgers!kb2ear!princeton!phoenix.Princeton.EDU!rtbunker
  2. From: rtbunker@phoenix.Princeton.EDU (Ross T. Bunker)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: printf() in Think C *fixed*
  5. Message-ID: <1992Jul24.151027.28751@Princeton.EDU>
  6. Date: 24 Jul 92 15:10:27 GMT
  7. Sender: news@Princeton.EDU (USENET News System)
  8. Organization: Princeton University
  9. Lines: 23
  10. Originator: news@ernie.Princeton.EDU
  11. Nntp-Posting-Host: phoenix.princeton.edu
  12.  
  13. Well, I got a couple of replies about an apparent bug in printf() when
  14. printing strings > 32K.  The consensus seemed to be that it was the usual 32
  15. bit vs. 16 bit int problem...
  16.  
  17. Recompiling the ANSI libraries with 4 byte ints solved it.  Seems printf
  18. calculates the length of the string and stores it in an int instead of a
  19. long.  I hate 2-byte ints. :-)
  20.  
  21. For those of you who were wondering why in the world we were printing 32K
  22. strings, this is a unix portand we were testing the command line part of
  23. database retreival program.  The search code can return very long strings,
  24. and we were testing it for a large case.  In the eventual implementation we
  25. won't even use printf...but I wanted to be sure it wasn't something wrong
  26. with our code. :-)
  27.  
  28. Thanks to those who replied!
  29.  
  30.  
  31. -- 
  32. ------------------------------------------------------------------------------
  33. :)ross                            | I don't have to take this abuse from you -- 
  34. Internet - rtbunker@princeton.edu | I've got hundreds of people waiting to abuse
  35. Bitnet   - rtbunker@pucc.bitnet   | me.  --Bill Murray, "Ghostbusters"
  36.