NetBSD-Bugs archive

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

kern/50947: src/sys/compat/common/kern_time_50.c:296]: (style) Suspicious condition



>Number:         50947
>Category:       kern
>Synopsis:       src/sys/compat/common/kern_time_50.c:296]: (style) Suspicious condition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 11 17:15:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160311
>Organization:
>Environment:
>Description:
src/sys/compat/common/kern_time_50.c:296]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.


Source code is


    if (itvp &&
        (error = copyin(itvp, &aitv50, sizeof(aitv50)) != 0))

Maybe better code

      if (itvp &&
        ((error = copyin(itvp, &aitv50, sizeof(aitv50))) != 0))

  



>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index