/*
* LIBUSB interface code for CUPS.
*
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2020 by Apple Inc.
*
- * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0. See the file "LICENSE" for more
+ * information.
*/
/*
err = libusb_init(NULL);
if (err)
{
- fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
- "libusb error %i\n", (int)err);
+ fprintf(stderr, "ERROR: Unable to initialize USB access via libusb, libusb error %i (%s)\n", (int)err, libusb_strerror((int)err));
return (NULL);
}
protocol = 0;
for (altset = 0, altptr = ifaceptr->altsetting;
- altset < ifaceptr->num_altsetting;
+ altset < ifaceptr->num_altsetting; // lgtm [cpp/comparison-with-wider-type]
altset ++, altptr ++)
{
/*
* Make sure this loop executes no more than once every 250 miliseconds...
*/
- if ((readstatus != LIBUSB_SUCCESS || rbytes == 0) &&
- (g.wait_eof || !g.read_thread_stop))
+ if ((g.wait_eof || !g.read_thread_stop))
{
gettimeofday(&now, NULL);
if (timercmp(&now, &end, <))