Date: Thu, 2 Sep 1999 11:10:02 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Peter Restall cc: djgpp AT delorie DOT com Subject: Re: : Re^2: sscanf() fluffs my program up ! In-Reply-To: <199909011908.UAA01585@burdock.restall.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 1 Sep 1999, Peter Restall wrote: > Thanks. However, I tried the '%hd' and '%hX', but to no avail. The new code > I used is that given below: > sscanf(modedef, "%[^:]:%hdx%hd:%hd:%hd:%hX:%hX:%hX", > mode->name, > &mode->width, > &mode->height, > &mode->depth, > &mode->flags, > &seg, > &off, > &mode->num); > > But it still doesn't work. Are the symptoms *exactly* the same with the new code? > 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.