On Tue, Sep 25, 2012 at 6:30 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> On Tue, Sep 25, 2012 at 10:28:06AM -0700, Jason Gerecke wrote:
>> Commit cff344b1 modified the null-handling of wcmCheckSource, such
>> that the wrong result will be returned if either/both  fsource and
>> psource are null.
>>
>> Signed-off-by: Jason Gerecke <killert...@gmail.com>
>> ---
>>  src/wcmValidateDevice.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
>> index a296984..7551d75 100644
>> --- a/src/wcmValidateDevice.c
>> +++ b/src/wcmValidateDevice.c
>> @@ -49,13 +49,17 @@ static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t 
>> min_maj)
>>                       char* fsource = xf86CheckStrOption(pInfo->options, 
>> "_source", NULL);
>>                       char* psource = xf86CheckStrOption(pDevices->options, 
>> "_source", NULL);
>>
>> +                     if (!fsource)
>> +                             fsource = "";
>> +                     if (!psource)
>> +                             psource = "";
>> +
>
> Instead just use the 'deflt' argument to xf86CheckStrOption
>     char* psource = xf86CheckStrOption(pDevices->options, "_source", "");
>
> With that change, Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net>
>
> Cheers,
>    Peter
>
>
As sensible as that is, putting a string literal there causes spurious
warnings. Addressing those warnings was the whole point of the
referenced patch(es), and I'm hesitant to re-introduce them. We'd
still be much better off than before the cleanup, but the more
warnings there are, the easier it is to overlook legitimate ones.

Jason

---
When you're rife with devastation / There's a simple explanation:
You're a toymaker's creation / Trapped inside a crystal ball.
And whichever way he tilts it / Know that we must be resilient
We won't let them break our spirits / As we sing our silly song.

>>                       if (pCommon->min_maj &&
>>                               pCommon->min_maj == min_maj)
>>                       {
>>                               /* only add the new tool if the matching 
>> major/minor
>>                               * was from the same source */
>> -                             if ((!fsource && !psource) ||
>> -                                 (fsource && psource && strcmp(fsource, 
>> psource)))
>> +                             if (strcmp(fsource, psource))
>>                               {
>>                                       match = 1;
>>                                       break;
>> --
>> 1.7.12

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to