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:
3
nmap.cc
3
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. */
|
||||
|
||||
Reference in New Issue
Block a user