forked from vejeta/conquer
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Bug Type
CODE-QUALITY - Assignment in conditional expression
Severity
Low
Phase Discovered
Phase 4: Warning Elimination - move.c modernization
Files Affected
- move.c:143
Description
Line 143 uses assignment within if condition: if((armynum=getselunit())<0)
This relies on side effects and reduces code readability.
Code Location
move.c:143
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((armynum=getselunit())<0) {
// Recommended:
armynum = getselunit();
if(armynum < 0) {Session History
- Discovered during Phase 4 warning elimination session
- Noted for post-modernization cleanup
Metadata
Metadata
Assignees
Labels
No labels