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
6a1a59f9
Commit
6a1a59f9
authored
Mar 22, 2004
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cargs.c: arguments were not correctly purged.
parent
5df82de5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
13 deletions
+45
-13
ChangeLog
ChangeLog
+4
-0
cargs.c
cargs.c
+11
-12
Makefile.am
test/Makefile.am
+1
-1
cargstest.c
test/cargstest.c
+29
-0
No files found.
ChangeLog
View file @
6a1a59f9
2004-03-22 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* fix cargs.c (hopefully for the last time):
arguments were not correctly purged
2004-03-15 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* fix libvncserver-config to again return a linker when
called with --link
...
...
cargs.c
View file @
6a1a59f9
...
...
@@ -46,7 +46,6 @@ void rfbPurgeArguments(int* argc,int* position,int count,char *argv[])
if
(
amount
)
memmove
(
argv
+
(
*
position
),
argv
+
(
*
position
)
+
count
,
sizeof
(
char
*
)
*
amount
);
(
*
argc
)
-=
count
;
(
*
position
)
--
;
}
rfbBool
...
...
@@ -127,11 +126,12 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[])
}
rfbScreen
->
progressiveSliceHeight
=
atoi
(
argv
[
++
i
]);
}
else
{
/* we just remove the processed arguments from the list */
i
f
(
i
!=
i1
)
rfbPurgeArguments
(
argc
,
&
i1
,
i
-
i1
,
argv
)
;
i
++
;
i
1
=
i
;
continue
;
}
i1
++
;
/* we just remove the processed arguments from the list */
rfbPurgeArguments
(
argc
,
&
i1
,
i
-
i1
+
1
,
argv
);
i
=
i1
;
}
return
TRUE
;
...
...
@@ -157,12 +157,11 @@ rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc, char *argv[])
}
else
if
(
strcmp
(
argv
[
i
],
"-height"
)
==
0
)
{
*
height
=
atoi
(
argv
[
++
i
]);
}
else
{
/* we just remove the processed arguments from the list */
if
(
i
!=
i1
)
if
(
i
!=
i1
)
rfbPurgeArguments
(
argc
,
&
i1
,
i
-
i1
,
argv
);
i
++
;
i1
=
i
;
continue
;
}
i1
++
;
rfbPurgeArguments
(
argc
,
&
i1
,
i
-
i1
,
argv
)
;
i
=
i1
;
}
return
TRUE
;
...
...
test/Makefile.am
View file @
6a1a59f9
CFLAGS
=
-I
..
-g
-Wall
noinst_PROGRAMS
=
tight-1
noinst_PROGRAMS
=
tight-1
cargstest
LDADD
=
../libvncserver.a ../libvncclient/libvncclient.a
test/cargstest.c
0 → 100644
View file @
6a1a59f9
#include <rfb/rfb.h>
int
main
(
int
argc
,
char
**
argv
)
{
int
fake_argc
=
6
;
char
*
fake_argv
[
6
]
=
{
"dummy_program"
,
"-alwaysshared"
,
"-httpport"
,
"3002"
,
"-nothing"
,
"-dontdisconnect"
};
rfbScreenInfoPtr
screen
;
rfbBool
ret
=
0
;
screen
=
rfbGetScreen
(
&
fake_argc
,
fake_argv
,
1024
,
768
,
8
,
3
,
1
);
#define CHECK(a,b) if(screen->a!=b) { fprintf(stderr,#a " is %d (should be " #b ")\n",screen->a); ret=1; }
CHECK
(
width
,
1024
);
CHECK
(
height
,
768
);
CHECK
(
rfbAlwaysShared
,
TRUE
);
CHECK
(
httpPort
,
3002
);
CHECK
(
rfbDontDisconnect
,
TRUE
);
if
(
fake_argc
!=
2
)
{
fprintf
(
stderr
,
"fake_argc is %d (should be 2)
\n
"
,
fake_argc
);
ret
=
1
;
}
if
(
strcmp
(
fake_argv
[
1
],
"-nothing"
))
{
fprintf
(
stderr
,
"fake_argv[1] is %s (should be -nothing)
\n
"
,
fake_argv
[
1
]);
ret
=
1
;
}
return
ret
;
}
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