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