1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 00:19:01 +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

@@ -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++;