NetBSD-Bugs archive

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

misc/48338: netbsd-iscsi-20080207/src/util.c:1165: possible bad if test ?



>Number:         48338
>Category:       misc
>Synopsis:       netbsd-iscsi-20080207/src/util.c:1165: possible bad if test ?
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 24 18:55:01 +0000 2013
>Originator:     David Binderman
>Release:        8
>Organization:
>Environment:
Linux
>Description:
I just compiled package netbsd-iscsi on Linux with extra flag -Wlogical-op

It said

util.c:1165:2: warning: logical 'or' of collectively exhaustive tests is always 
true [-Wlogical-op]

Source code is

    if ((text[0] == '0') && (text[1] != 'x' || text[1] != 'X')) {

Suggest swap || for &&

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index