mirror of
https://github.com/clearml/dropbear
synced 2025-02-07 13:21:15 +00:00
Warn rather than fail if flags have trailing parts
This commit is contained in:
parent
00798ca8cc
commit
e4827025be
@ -220,8 +220,9 @@ void cli_getopts(int argc, char ** argv) {
|
||||
/* A flag *waves* */
|
||||
char c = argv[i][1];
|
||||
if (strlen(argv[i]) != 2) {
|
||||
/* Ensure only one flag per hyphen. '?' falls through to print help */
|
||||
c = '?';
|
||||
/* We only handle one flag per hyphen */
|
||||
fprintf(stderr, "Warning, trailing '%s' of '%s' is ignored.\n",
|
||||
&argv[i][2], argv[i]);
|
||||
}
|
||||
switch (c) {
|
||||
case 'y': /* always accept the remote hostkey */
|
||||
|
@ -191,8 +191,9 @@ void svr_getopts(int argc, char ** argv) {
|
||||
if (argv[i][0] == '-') {
|
||||
char c = argv[i][1];
|
||||
if (strlen(argv[i]) != 2) {
|
||||
/* Ensure only one flag per hyphen. '?' falls through to print help */
|
||||
c = '?';
|
||||
/* We only handle one flag per hyphen */
|
||||
fprintf(stderr, "Warning, trailing '%s' of '%s' is ignored.\n",
|
||||
&argv[i][2], argv[i]);
|
||||
}
|
||||
switch (c) {
|
||||
case 'b':
|
||||
|
Loading…
Reference in New Issue
Block a user