1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 12:41:29 +00:00

Clarify and avoid compiler warning

clang 3.4.1 on FreeBSD gave this warning:

    nmap.cc:3064:48: warning: use of logical '||' with constant operand
          [-Wconstant-logical-operand]
        return file_is_readable(filename_returned) || 1;
    nmap.cc:3064:48: note: use '|' for a bitwise operation

Changed to match the intent: return 1 if file_is_readable returns 0, otherwise
return that non-0 value.
This commit is contained in:
dmiller
2016-06-21 23:40:36 +00:00
parent bff2dc4563
commit 1d3aa1ee57

View File

@@ -3061,7 +3061,8 @@ int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) {
name. Return a positive result even if the file doesn't exist or is not
readable. It is the caller's responsibility to report the error if the
file can't be accessed. */
return file_is_readable(filename_returned) || 1;
res = file_is_readable(filename_returned);
return res != 0 ? res : 1;
}
/* Try updates directory first. */