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 - commands.c modernization
Files Affected
- commands.c:447
Description
Line 447 uses assignment within if condition: if((newdes=getch())==DSPECIAL)
This relies on side effects and reduces code readability.
Code Location
commands.c:447
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((newdes=getch())==DSPECIAL) {
// Recommended:
newdes = getch();
if(newdes == DSPECIAL) {Session History
- Discovered during Phase 4 warning elimination session (commands.c)
- Similar pattern found in move.c:143 (Issue CODE-QUALITY: Assignment in if condition - move.c:143 #3)
- Noted for post-modernization cleanup
Metadata
Metadata
Assignees
Labels
No labels