Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!hsdndev!husc6!endor!siegel From: siegel@endor.uucp (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Bug in THINK C???? Message-ID: <5754@husc6.harvard.edu> Date: 19 Feb 91 01:09:02 GMT References: <9102181103.aa10735@Bonnie.ics.uci.edu> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Organization: Symantec Language Products Group Lines: 27 In article <9102181103.aa10735@Bonnie.ics.uci.edu> rhutchin@Bonnie.ICS.UCI.EDU writes: >Well, more like "Bug in THINK C 4.02 update..." > >Here's something that is compiled into "error-free" object code in THINK C 4.0: > > NumToString((long) BuffCopy, tempStr); > >where: > char *BuffCopy > char *tempStr; /* sorry, forget the ";" above */ Unless "tempStr" is initialized to point at real storage, the NumToString call will write the result out into random memory, which can cause all sorts of unpredictable behavior, bus errors being among the symptoms. Try: char *buffCopy; Str255 tempStr; NumToString(buffCopy, tempStr); R. Rich Siegel Symantec Languages Group Internet: siegel@endor.harvard.edu "I was just trying to be subtle. That's my job, isn't it?"