1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-27 18:09:01 +00:00

Changes from flight back from ShmooCon

This commit is contained in:
fyodor
2006-01-19 07:29:12 +00:00
parent ee6dbf8877
commit 53c315a49c
9 changed files with 158 additions and 107 deletions

View File

@@ -209,6 +209,23 @@ char *chomp(char *string) {
return string;
}
/* Compare a canonical option name (e.g. "max-scan-delay") with a
user-generated option such as "max_scan_delay" and returns 0 if the
two values are considered equivalant (for example, - and _ are
considered to be the same), nonzero otherwise. */
int optcmp(const char *a, const char *b) {
while(*a && *b) {
if ((*a == '_' || *a == '-') && (*b != '_' && *b != '-'))
return 1;
if (*a != *b)
return 1;
a++; b++;
}
if (*a || *b)
return 1;
return 0;
}
/* Convert a comma-separated list of ASCII u16-sized numbers into the
given 'dest' array, which is of total size (meaning sizeof() as
opposed to numelements) of destsize. If min_elem and max_elem are