TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Mike Bilow
from: Paul Edwards
date: 1995-04-01 07:01:52
subject: 32-bit bink hack

PE>     ret = sscanf(buf, "%d %d p", &x, &y);

MB> I think that EMX is behaving correctly.  If 'p' is not matched exactly, 
MB> that is a failure of the input stream, and sscanf() should return EOF.

MB> I checked using Borland C and Watcom C, and both return 2.  Reading the 
MB> spec document, however, suggests that the proper return is, in fact, EOF.

I disagree, here is the relevant quote...


"The sscanf function returns the value of the macro EOF if an
input failure occurs before any conversion.  Otherwise, the
                     ^^^^^^                  ^^^^^^^^^
sscanf function returns the number of input items assigned,
which can be fewer than provided for, or even zero, in the 
event of an early matching failure".

Paul
@EOT:

---
* Origin: This is just another kludge line like SEENBY (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.