Skip to content

Commit

Permalink
Viewer: Prevent exception if '-' passed as arg
Browse files Browse the repository at this point in the history
  • Loading branch information
dcommander committed Aug 7, 2024
1 parent ca0f65c commit ec53aeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/com/turbovnc/vncviewer/VncViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public VncViewer(String[] argv) {

if (argv[i].charAt(0) == '-') {
int index = 1;
if (argv[i].charAt(1) == '-' && argv[i].length() > 2)
if (argv[i].length() > 2 && argv[i].charAt(1) == '-')
index = 2;
if (i + 1 < argv.length) {
if (params.set(argv[i].substring(index), argv[i + 1], true)) {
Expand Down

0 comments on commit ec53aeb

Please sign in to comment.