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 (strcmp(argv[i], "-s") == 0) {
|
||||||
if (argc <= i + 1 || sscanf(argv[i + 1], "%" B_SCNu16, &sshPort) != 1) {
|
if((i + 1 < argc) && sscanf(argv[i + 1], "%" B_SCNu16, &sshPort) == 1) {
|
||||||
print_usage(argv[0]);
|
i++;
|
||||||
return 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
|
||||||
useSSH = true;
|
useSSH = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user