Context
parse_int_parameter in room/src/doom/m_config.rs parses integer values from .cfg files.
C behavior
C ParseIntParameter falls back to sscanf("%i", ...), which recognizes:
0x / 0X prefix as hex,
- leading
0 as octal,
- otherwise decimal.
So a config value like 0755 is parsed as octal 493.
Rust behavior
After the hex branch, the Rust port uses str::parse::<i32>(), which rejects octal-style leading zeros and accepts only decimal. Values like 0755 parse as decimal 755 (or fail and return 0 in older Rust - actually leading zeros are accepted in decimal by parse::<i32>, but no octal interpretation occurs).
Impact
Any .cfg value relying on sscanf %i octal interpretation silently changes meaning. The risk is low but real for binding bytes like 077 (octal 63 in C, decimal 77 in Rust).
Location
room/src/doom/m_config.rs:643 (flagged with // FIXME:).
Suggested fix
Detect a leading 0 (not followed by x/X) and parse as octal via i32::from_str_radix(..., 8), then fall back to decimal.
Context
parse_int_parameterinroom/src/doom/m_config.rsparses integer values from.cfgfiles.C behavior
C
ParseIntParameterfalls back tosscanf("%i", ...), which recognizes:0x/0Xprefix as hex,0as octal,So a config value like
0755is parsed as octal 493.Rust behavior
After the hex branch, the Rust port uses
str::parse::<i32>(), which rejects octal-style leading zeros and accepts only decimal. Values like0755parse as decimal 755 (or fail and return 0 in older Rust - actually leading zeros are accepted in decimal byparse::<i32>, but no octal interpretation occurs).Impact
Any
.cfgvalue relying onsscanf %ioctal interpretation silently changes meaning. The risk is low but real for binding bytes like077(octal 63 in C, decimal 77 in Rust).Location
room/src/doom/m_config.rs:643(flagged with// FIXME:).Suggested fix
Detect a leading
0(not followed byx/X) and parse as octal viai32::from_str_radix(..., 8), then fall back to decimal.