TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Roy McNeill
from: Paul Edwards
date: 1995-03-30 07:13:20
subject: emx bug

RM> int x,y,z;
RM> char buf[50] = "5 6";
RM> ret = sscanf(buf, "%d %d %d", &x, &y, &z);

RM> It just returns the number of fields read and converted. Perhaps
RM> the Borland line should have read "If sscanf attempts to start
RM> reading at end-of-string, the return value is EOF."

RM> What does the standard say it should do?

If there is an input failure before any conversion it should
return EOF.  E.g. if you had done sscanf(buf, "hello %d %d",
&x, &y);
and then given buf = "goodbye 5 6".  BFN.

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™.