1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 08:29:04 +00:00

Add -v0 to mean no output to stdout. Closes #265. Fixes #236.

This commit is contained in:
dmiller
2016-01-06 16:26:07 +00:00
parent 7c3f57675e
commit b9367a6f53
2 changed files with 9 additions and 0 deletions

View File

@@ -1,5 +1,9 @@
# Nmap Changelog ($Id$); -*-text-*-
o When provided a verbosity of 0 (-v0), Nmap will not output any text to the
screen. This happens at the time of argument parsing, so the usual meaning of
"verbosity 0" is preserved. [isjing]
o [Nsock] Avoid a crash on Windows and other systems which use nbase's
vasprintf implementation. In the case of unknown OpenSSL errors,
ERR_reason_error_string would return NULL, which could not be printed with

View File

@@ -1422,6 +1422,11 @@ void parse_options(int argc, char **argv) {
case 'v':
if (optarg && isdigit(optarg[0])) {
o.verbose = atoi(optarg);
if (o.verbose == 0) {
o.nmap_stdout = fopen(DEVNULL, "w");
if (!o.nmap_stdout)
fatal("Could not assign %s to stdout for writing", DEVNULL);
}
} else {
const char *p;
o.verbose++;