From 1d3aa1ee57aaa92bee0901c63080a7c7edba5ca6 Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 21 Jun 2016 23:40:36 +0000 Subject: [PATCH] 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. --- nmap.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nmap.cc b/nmap.cc index 50d028206..53ef9128e 100644 --- a/nmap.cc +++ b/nmap.cc @@ -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. */