Date: Thu, 2 Sep 1999 20:57:14 +0100 From: Peter Restall Message-Id: <199909021957.UAA00512@burdock.restall.net> To: djgpp AT delorie DOT com Subject: Re^3: sscanf() fluffs my program up ! Reply-To: djgpp AT delorie DOT com On Thu, 2 Sep 1999 11:10:02 +0300 (IDT), Eli replied: > Are the symptoms *exactly* the same with the new code? Yes. The file-handle that I said the code modified is part of a linked-list, so the symptom is simply an infinite loop when the file comes to be closed (because I can't match the address, and the handle isn't NULL so it's not caught). I suppose I could add a case for checking for invalid file-handles. It won't prevent the error, but it will prevent an infinite loop. >> The thing is, the code works fine in Linux, which is usually >> the first to complain if there's a segmentation violation or something. > > This doesn't prove anything. Linux uses an entirely different library > with a different implementation of `sscanf'. It could mean that > DJGPP's version has a bug that reveals itself in your case, but it > also could mean that the bugs in your code manifest themselves in a > different manner in these two environments. > If you cannot figure this out, please post a complete short program > that can be compiled and debugged, and which exhibits this behavior. > Then someone will probably find the problem. That might be kinda hard. I'm making a 3D engine, and I've got a couple of hundred kilobytes of source. If I made a smaller program, the chances are that whatever is going wrong will modify in an unused chunk of memory, so it won't have any adverse effect. I'll knock together an independent form of my video datafile-loading code, and see if the same thing happens. If it does, I'll post it. Thanks, Pete =:-) -- /*************** [burdock] ****************/ /* ____/| pete AT restall DOT net */ /* \ o.O| http://www.iirc.net/petes/ */ /* =(_)= */ /* U */ /******************************************/ /******************************* [Windoze 98] ********************************/ /* Windows 98: n. (Alex Satrapa). */ /* 64 bits (and pieces) of bugs (and fixes) and featuritis tacked on to 32 */ /* bit extensions and a graphical shell for a 16 bit patch to an 8 bit */ /* operating system originally coded for a 4 bit microprocessor, written */ /* by a 2 bit company that can't stand 1 bit of competition, and has not a */ /* bit of respect for their customers. */ /*****************************************************************************/