NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/50953: src/usr.bin/xstr/xstr.c:393]:style) Suspicious condition



>Number:         50953
>Category:       bin
>Synopsis:       src/usr.bin/xstr/xstr.c:393]:style) Suspicious condition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 11 17:30:01 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160311
>Organization:
>Environment:
>Description:

src/usr.bin/xstr/xstr.c:393]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Source code is

   while (--rmdr > 0 && (c = xgetc(file) != 0 && c != EOF))


Maybe better code

   while (--rmdr > 0 && ((c = xgetc(file)) != 0 && c != EOF))



 


   

  



>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index