diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-08-07 22:49:21 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-08-07 22:49:21 +0000 |
commit | ee6ddad2570bbfe4ac3c3378b8765532b6d7cde5 (patch) | |
tree | 9bd0e962dcfd504055bf1dd837f8cf9468e2164b /backend/usb-libusb.c | |
parent | 4a4b4f99149e8241247e0116cc18fec762fdb1ea (diff) | |
download | cups-ee6ddad2570bbfe4ac3c3378b8765532b6d7cde5.tar.gz |
Merge final 1.4.0 (r8761) changes.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1629 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'backend/usb-libusb.c')
-rw-r--r-- | backend/usb-libusb.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/usb-libusb.c b/backend/usb-libusb.c index 3cb61e395..d5c6ae5b6 100644 --- a/backend/usb-libusb.c +++ b/backend/usb-libusb.c @@ -418,12 +418,14 @@ get_device_id(usb_printer_t *printer, /* I - Printer */ * and then limit the length to the size of our buffer... */ - if (length > (bufsize - 2)) + if (length > bufsize) length = (((unsigned)buffer[1] & 255) << 8) + ((unsigned)buffer[0] & 255); - if (length > (bufsize - 2)) - length = bufsize - 2; + if (length > bufsize) + length = bufsize; + + length -= 2; /* * Copy the device ID text to the beginning of the buffer and |