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 6, 2024
1 parent c050a10 commit 1324135
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 @@ -470,7 +470,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])) {
Expand Down

0 comments on commit 1324135

Please sign in to comment.