Mail Archives: djgpp/1999/09/02/13:47:49

Date: Thu, 2 Sep 1999 11:10:02 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Peter Restall <pete AT restall DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: : Re^2: sscanf() fluffs my program up !
In-Reply-To: <>
Message-ID: <Pine.SUN.3.91.990902110925.4794U-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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.

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019