diff options
author | dscho <dscho> | 2004-03-22 08:40:51 +0000 |
---|---|---|
committer | dscho <dscho> | 2004-03-22 08:40:51 +0000 |
commit | 6a1a59f90e8aa12ee50aaad0244a9f1ad1d85900 (patch) | |
tree | 638fa4305c45ddad116a357cf3cfc1ce88f4d6a4 /cargs.c | |
parent | 5df82de5ce647592f6256b5c1b199cec775f9ce8 (diff) | |
download | libtdevnc-6a1a59f90e8aa12ee50aaad0244a9f1ad1d85900.tar.gz libtdevnc-6a1a59f90e8aa12ee50aaad0244a9f1ad1d85900.zip |
fix cargs.c: arguments were not correctly purged.
Diffstat (limited to 'cargs.c')
-rw-r--r-- | cargs.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -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 */ - if(i != i1) - rfbPurgeArguments(argc,&i1,i-i1,argv); - } - i1++; + i++; + i1=i; + continue; + } + /* 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); - } - i1++; + i++; + i1=i; + continue; + } + rfbPurgeArguments(argc,&i1,i-i1,argv); i=i1; } return TRUE; |