Re: [spice-gtk Win32 v3 05/12] Make SpiceUsbDevice a gobject, instead of a box for libusb_device

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

 



On Thu, Jun 28, 2012 at 03:42:28PM +0300, Uri Lublin wrote:
> On 06/28/2012 01:09 PM, Christophe Fergeau wrote:
> >On Thu, Jun 28, 2012 at 04:46:34AM +0300, Uri Lublin wrote:
> >>+    if ((vid>  0)&&  (pid>  0)) {
> >>+        descriptor = g_strdup_printf("[%04x:%04x]", vid, pid);
> >I don't think this will do the right thing in error cases, get_vid returns
> >an uint16_t which value is 0xffff when there's an error, it will be turned
> >into 65535 when it's cast to int, it won't be -1. I haven't looked at the
> >rest of the patch for similar issues.
> 
> I'll change vid, pid values to 0 on error.

Great, this should solve this issue nicely (assuming 0 is not a valid value
for any of these identifiers).

Christophe

Attachment: pgpLOtQ6yNjup.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]