2011/6/30 Jie Zhang <[email protected]>:
> 2011/6/30 steve tell <[email protected]>:
>>> Error: chain.c:107 urj_tap_chain_connect() syntax: parallel cable
>>> requires >= 3 parameters
>>
>> @@ -101,10 +101,10 @@ urj_tap_chain_connect (urj_chain_t *chain, const char 
>> *drivername, char *params[
>>
>>     if (driver->device_type == URJ_CABLE_DEVICE_PARPORT)
>>      {
>> -        if (paramc < 3)
>> +        if (paramc < 1)
>
> "< 2" ?
>
>>          {
>>              urj_error_set (URJ_ERROR_SYNTAX,
>> -                           "parallel cable requires >= 3 parameters");
>> +                           "parallel cable requires >= 2 parameters, got 
>> %d", paramc);
>
> ">=4" ?
>
>>              return URJ_STATUS_FAIL;
>>          }
>>          for (j = 0; j < URJ_CABLE_PARPORT_N_DEVS; j++)
>
>
I have committed the fix I suggested. Some explanations:

Without the first change, UrJTAG will segment fault for "cable DLC5 parallel".

As for the second change, it seems according to UrJTAG's convention,
the number of parameters of "cable DLC5 parallel"counts 3, i.e.
including "cable" itself. It looks a little strange for me. But since
all commands follow the same convention, we should do the same for the
"cable" command for now.

Jie
  * src/tap/chain.c (urj_tap_chain_connect): Correct checking of the
    parameter number of parallel cable.

Index: src/tap/chain.c
===================================================================
--- src/tap/chain.c	(revision 1956)
+++ src/tap/chain.c	(working copy)
@@ -96,10 +96,10 @@ urj_tap_chain_connect (urj_chain_t *chai
 
     if (driver->device_type == URJ_CABLE_DEVICE_PARPORT)
     {
-        if (paramc < 1)
+        if (paramc < 2)
         {
             urj_error_set (URJ_ERROR_SYNTAX,
-                           "parallel cable requires >= 2 parameters, got %d", paramc);
+                           "parallel cable requires >= 4 parameters, got %d", paramc);
             return URJ_STATUS_FAIL;
         }
         for (j = 0; j < URJ_CABLE_PARPORT_N_DEVS; j++)
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to