Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
b7dae538
Commit
b7dae538
authored
Jan 14, 2005
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
argc and argv may be zero (which means to ignore them)
parent
e78a41c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
30 deletions
+36
-30
vncviewer.c
libvncclient/vncviewer.c
+36
-30
No files found.
libvncclient/vncviewer.c
View file @
b7dae538
...
@@ -188,38 +188,44 @@ static rfbBool rfbInitConnection(rfbClient* client)
...
@@ -188,38 +188,44 @@ static rfbBool rfbInitConnection(rfbClient* client)
rfbBool
rfbInitClient
(
rfbClient
*
client
,
int
*
argc
,
char
**
argv
)
{
rfbBool
rfbInitClient
(
rfbClient
*
client
,
int
*
argc
,
char
**
argv
)
{
int
i
,
j
;
int
i
,
j
;
if
(
client
->
programName
==
0
)
if
(
argv
==
0
||
argc
==
0
||
*
argc
==
0
)
{
client
->
programName
=
argv
[
0
];
client
->
programName
=
""
;
client
->
serverHost
=
""
;
for
(
i
=
1
;
i
<
*
argc
;
i
++
)
{
client
->
serverPort
=
5900
;
j
=
i
;
}
else
{
if
(
strcmp
(
argv
[
i
],
"-listen"
)
==
0
)
{
if
(
client
->
programName
==
0
)
listenForIncomingConnections
(
client
);
client
->
programName
=
argv
[
0
];
break
;
}
else
if
(
strcmp
(
argv
[
i
],
"-play"
)
==
0
)
{
for
(
i
=
1
;
i
<
*
argc
;
i
++
)
{
client
->
serverPort
=
-
1
;
j
=
i
;
j
++
;
if
(
strcmp
(
argv
[
i
],
"-listen"
)
==
0
)
{
}
else
if
(
i
+
1
<*
argc
&&
strcmp
(
argv
[
i
],
"-encodings"
)
==
0
)
{
listenForIncomingConnections
(
client
);
client
->
appData
.
encodingsString
=
argv
[
i
+
1
];
break
;
j
+=
2
;
}
else
if
(
strcmp
(
argv
[
i
],
"-play"
)
==
0
)
{
}
else
{
client
->
serverPort
=
-
1
;
char
*
colon
=
strchr
(
argv
[
i
],
':'
);
j
++
;
}
else
if
(
i
+
1
<*
argc
&&
strcmp
(
argv
[
i
],
"-encodings"
)
==
0
)
{
if
(
colon
)
{
client
->
appData
.
encodingsString
=
argv
[
i
+
1
];
client
->
serverHost
=
strdup
(
argv
[
i
]);
j
+=
2
;
client
->
serverHost
[(
int
)(
colon
-
argv
[
i
])]
=
'\0'
;
client
->
serverPort
=
atoi
(
colon
+
1
);
}
else
{
}
else
{
client
->
serverHost
=
strdup
(
argv
[
i
]);
char
*
colon
=
strchr
(
argv
[
i
],
':'
);
if
(
colon
)
{
client
->
serverHost
=
strdup
(
argv
[
i
]);
client
->
serverHost
[(
int
)(
colon
-
argv
[
i
])]
=
'\0'
;
client
->
serverPort
=
atoi
(
colon
+
1
);
}
else
{
client
->
serverHost
=
strdup
(
argv
[
i
]);
}
if
(
client
->
serverPort
>=
0
&&
client
->
serverPort
<
5900
)
client
->
serverPort
+=
5900
;
}
/* purge arguments */
if
(
j
>
i
)
{
*
argc
-=
j
-
i
;
memmove
(
argv
+
i
,
argv
+
j
,(
*
argc
-
i
)
*
sizeof
(
char
*
));
i
--
;
}
}
if
(
client
->
serverPort
>=
0
&&
client
->
serverPort
<
5900
)
client
->
serverPort
+=
5900
;
}
/* purge arguments */
if
(
j
>
i
)
{
*
argc
-=
j
-
i
;
memmove
(
argv
+
i
,
argv
+
j
,(
*
argc
-
i
)
*
sizeof
(
char
*
));
i
--
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment