RemoteDesktop : improvement on parsing optional ssh port
Change-Id: Id656da88b68b0ae033e17711191e46d9f5961cc4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/9244 Reviewed-by: Adrien Destugues <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
e19e27b42d
commit
1e4a50ea92
@@ -90,12 +90,10 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "-s") == 0) {
|
||||
if (argc <= i + 1 || sscanf(argv[i + 1], "%" B_SCNu16, &sshPort) != 1) {
|
||||
print_usage(argv[0]);
|
||||
return 2;
|
||||
if((i + 1 < argc) && sscanf(argv[i + 1], "%" B_SCNu16, &sshPort) == 1) {
|
||||
i++;
|
||||
}
|
||||
|
||||
i++;
|
||||
useSSH = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user