9front - general discussion about 9front
 help / color / mirror / Atom feed
* libstdio fscanf regression
@ 2020-05-15  0:20 qwx
  2020-05-15  0:51 ` [9front] " ori
  0 siblings, 1 reply; 5+ messages in thread
From: qwx @ 2020-05-15  0:20 UTC (permalink / raw)
  To: 9front

Hello,

Commit 7551 (fix '%[]' specifiers and '%n' (thanks phil9)) seems to have
broken libstdio's *scanf (ape version untested).

Test case is games/doom's configuration file loading, which uses fscanf:
/sys/src/games/doom/m_misc.c:314

...

	    if (fscanf (f, "%79s %[^\n]\n", def, strparm) == 2)

...

This reads key value pairs, one per line, like:

mouse_sensitivity		5

Despite successfully reading both strings on each line, the fscanf call
now returns 1 instead of 2, and the check always fails.

The effect is that games/doom is unable to read in any value from the
configuration file, and since it still can write a config file on exit,
the file is clobbered and all values are reset to default upon quitting.

I haven't looked at ape's stdio, perhaps the code's semantics are slightly
different.

Thanks for the help,

qwx


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-15  2:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15  0:20 libstdio fscanf regression qwx
2020-05-15  0:51 ` [9front] " ori
2020-05-15  1:37   ` qwx
2020-05-15  1:42     ` ori
2020-05-15  2:06       ` qwx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).