Bug Type
CODE-QUALITY - Assignment in conditional expression
Severity
Low
Phase Discovered
Phase 4: Warning Elimination - commands.c modernization
Files Affected
Description
Line 1348 uses assignment within if condition: if((i = get_country())==(-1))
This relies on side effects and reduces code readability.
Code Location
commands.c:1348
Impact Assessment
- No functional impact - code works correctly
- Readability concern - assignment mixed with condition test
- Maintenance risk - harder to debug and understand
Recommended Resolution
Separate assignment from conditional test:
// Current (problematic):
if((i = get_country())==(-1)) {
// Recommended:
i = get_country();
if(i == (-1)) {
Session History
Bug Type
CODE-QUALITY - Assignment in conditional expression
Severity
Low
Phase Discovered
Phase 4: Warning Elimination - commands.c modernization
Files Affected
Description
Line 1348 uses assignment within if condition:
if((i = get_country())==(-1))This relies on side effects and reduces code readability.
Code Location
commands.c:1348
Impact Assessment
Recommended Resolution
Separate assignment from conditional test:
Session History