[DragonFlyBSD - Bug #3079] (Closed) usr.bin/bc/tty.c: 2 * Suspicious condition

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Sat Oct 21 16:54:00 PDT 2017


Issue #3079 has been updated by dillon.

Status changed from New to Closed

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

-Matt

----------------------------------------
Bug #3079: usr.bin/bc/tty.c: 2 * Suspicious condition
http://bugs.dragonflybsd.org/issues/3079#change-13279

* Author: dcb
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
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)





-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Bugs mailing list