forked from osmocom/wireshark
wslog: Add a diagnostic message.
This commit is contained in:
parent
b91801a870
commit
42c6c4781f
|
@ -199,11 +199,13 @@ int ws_log_parse_args(int *argc_ptr, char *argv[], void (*print_err)(const char
|
|||
value = *(ptr + 1);
|
||||
prune_extra = 1;
|
||||
|
||||
/* If the option value after the blank is missing or stars with '-' just ignore it.
|
||||
* But we should probably signal an error (missing required value). */
|
||||
if (value == NULL || !*value || *value == '-') {
|
||||
/* If the option value after the blank starts with '-' assume
|
||||
* it is another option. */
|
||||
print_err("Option \"%s\" requires a value.\n", *ptr);
|
||||
option = NULL;
|
||||
prune_extra = 0;
|
||||
ret += 1;
|
||||
}
|
||||
}
|
||||
else if (value[0] == '=') {
|
||||
|
@ -212,6 +214,7 @@ int ws_log_parse_args(int *argc_ptr, char *argv[], void (*print_err)(const char
|
|||
prune_extra = 0;
|
||||
}
|
||||
else {
|
||||
/* Option isn't known. */
|
||||
ptr += 1;
|
||||
count -= 1;
|
||||
continue;
|
||||
|
@ -236,6 +239,9 @@ int ws_log_parse_args(int *argc_ptr, char *argv[], void (*print_err)(const char
|
|||
ws_log_add_custom_file(fp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Option value missing or invalid, do nothing. */
|
||||
}
|
||||
|
||||
/*
|
||||
* We found a log option. We will remove it from
|
||||
|
|
Loading…
Reference in New Issue