Re: dvb-apps/util/[ca_]zap.c parameter parsing code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 29 June 2006 11:49, Graeme Christie wrote:
> Hi all,
>
> I'm just a ittle bit perplexed. The code in the dvb_apps repository for
> zap that parses the command line options,as far as I can tell, should
> (and does) always fail with the usage() message and drop out. Basically,
> the arpos and argc variables in the comparisons are around the wrong
> way, for example the current hg code reads:
>
> while(argpos != argc) {
>
>  if (!strcmp(argv[argpos], "-h")) {
>
>      usage();
>
>  } else if (!strcmp(argv[argpos], "-adapter")) {
>
>
>    if ((argpos - argc) < 2) //<--- will always be true, as argpos is < argc
>
>      usage();
>
>
>   if (sscanf(argv[argpos+1], "%i", &adapter_id) != 1)
>
> 	usage();
>
>   argpos+=2;
>
>   } else if (!strcmp(argv[argpos], "-frontend")) {
>
>   if ((argpos - argc) < 2)
>
>  	 usage();
>
>   if (sscanf(argv[argpos+1], "%i", &frontend_id) != 1)
>
> 	  usage();
>
>   argpos+=2;
>
> .
> .
> .
>
> Easily fixed, by swapping the argpos and argc arguments in all the
> (argpos - argc) if statements ........ The perplexing thing is, that
> according to hg  it's been like this for 6 months ... essentially, this
> program has done nothing but print out the -h usage instructions for the
> last six months 

All testing has been done without specifying a non-0 adapter id; just an 
oversight really. I don't have any twinhan cards.

> (as far as I remember at least , cz_zap has been renamed 
> to zap now, and I odon't know how to look the history for the deleted
> folder up via the web interface) ? Doesn't anyone *ever* test these
> things before they commit them ....

The entire dvb-apps tree is under heavy development right now - zap/ca_zap has 
never been officially released. It will start to firm up now as the base dvb 
libraries are function complete as of yesterday. Thanks for the bug report; I 
will fix it in a sec.

I've intentionally not touched szap so those tools will still work (eventually 
however, those tools will be completely replaced with the unified zap)

_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux