On Wed, May 23, 2012 at 11:03:28AM +0100, Bastien Nocera wrote:
> On Wed, 2012-05-23 at 15:24 +1000, Peter Hutterer wrote:
> > Match strings that terminate with a semi will have a final, empty, string
> > after g_strsplit(). Ignore those too, not just NULL strings.
> > 
> > Removes "failed to match '' for product/vendor IDs. Skipping." warnings from
> > tests.
> 
> This:
> strlen(strs[i]) > 0
> is pretty ugly.
> 
> *strs[i] != '\0'
> instead?

I think we have a different definition of ugly :) anyway, changed it locally.

Cheers,
  Peter

> 
> > Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> > ---
> >  libwacom/libwacom-database.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
> > index 6adeaa1..ef03c43 100644
> > --- a/libwacom/libwacom-database.c
> > +++ b/libwacom/libwacom-database.c
> > @@ -142,7 +142,7 @@ libwacom_matchstr_to_matches(WacomDevice *device, const 
> > char *match)
> >             return 0;
> >  
> >     strs = g_strsplit(match, ";", 0);
> > -   for (i = 0; strs[i] != NULL; i++) {
> > +   for (i = 0; strs[i] != NULL && strlen(strs[i]) > 0; i++) {
> >             char busstr[64];
> >             int vendor_id, product_id;
> >             WacomBusType bus;
> 
> 

------------------------------------------------------------------------------
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