aviralgarg05 commented on code in PR #3644:
URL: https://github.com/apache/nuttx-apps/pull/3644#discussion_r3597239645
##########
games/NXDoom/src/m_config.c:
##########
@@ -2098,7 +2098,9 @@ static void load_default_collection(default_collection_t
*collection)
while (!feof(f))
{
- if (fscanf(f, "%79s %99[^\n]\n", defname, strparm) != 2)
+ strparm[0] = '\0';
Review Comment:
not AI-guessed -- a config file left mid-write (unclean shutdown) had an
empty screenblocks= line. The old code passed that empty value straight to
set_variable() regardless of whether parsing actually succeeded, which is
exactly how screenblocks ended up at 0 and caused the divide-by-zero in
r_main.c.
Repro: truncate any line in the save config so the value side is empty, then
relaunch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]