Project

General

Profile

Bug #3079

usr.bin/bc/tty.c: 2 * Suspicious condition

Added by dcb 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
10/11/2017
Due date:
% Done:

0%


Description

usr.bin/bc/tty.c:34]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Source code is

while ((ret = tcsetattr(0, TCSADRAIN, t) == -1) && errno == EINTR)

Maybe better code

while (((ret = tcsetattr(0, TCSADRAIN, t)) == -1) && errno == EINTR)

dragonfly/usr.bin/bc/tty.c:44]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Source code is

while ((ret = tcgetattr(0, t) == -1) && errno == EINTR)

History

#1 Updated by dillon about 2 months ago

  • Status changed from New to Closed

Code actually works either way but syntax is clearly incorrect. Corrected syntax and committed into master.

-Matt

Also available in: Atom PDF