To: djgpp AT delorie DOT com Date: Tue, 11 Jan 2000 15:47:57 -0500 Subject: strcat() bug? Message-ID: <20000111.154802.-350271.2.roberts.j.whitlock@juno.com> X-Mailer: Juno 4.0.5 MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Juno-Line-Breaks: 11-14,16-29 X-Juno-Att: 0 X-Juno-RefParts: 0 From: Robert S Whitlock Reply-To: djgpp AT delorie DOT com Hi, I was writing my program like we all do, and I came across this bug. My log file wasn't working right, not putting messages into the file, and leaving extra newlines in it, too. Well, I'm pretty sure the strcat() function is the one to blame. When I use it, the problem is there. When I don't, the problem disappears. However, what really gets me is that strcat() messes up some of the other strings as well. If you run the program when you use the logfile, one of the messages in a completely different part of the program gets messed up. You can see that on one of the alerts when the program startrs up. If you don't use the logfile, it comes out just fine. WTF?!?!? Since the bug was obviously not contained to one spot, I thought I should show you the whole program together. But, I didn't want to post it all, so: Source: www.geocities.com/CapeCanaveral/Hangar/9520/prob.zip ^--6K Binaries, in case you can't reproduce it with the source: www.geocities.com/CapeCanaveral/Hangar/9520/probb.zip ^--213K I'm using djgpp 2.02 gcc 2.95.2 Allegro 3.9.30 WIP Windows 95 For me, this is truly a wtf. Any ideas? --Robert Whitlock http://www.geocities.com/CapeCanaveral/Hangar/9520/ ICQ 60123256