X-Git-Url: https://git.ao2.it/libam7xxx.git/blobdiff_plain/8fb663458b08cc5cb79ec824348919ee239b4da3..8f6efd04b7f47174cf9e93adbcd11c5779db0c7e:/src/am7xxx.c diff --git a/src/am7xxx.c b/src/am7xxx.c index ffdd59c..f874469 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -1,6 +1,6 @@ /* am7xxx - communication with AM7xxx based USB Pico Projectors and DPFs * - * Copyright (C) 2012 Antonio Ospite + * Copyright (C) 2012-2014 Antonio Ospite * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -832,7 +832,8 @@ out_libusb_close: } } - /* if we made it up to here we didn't find any device to open */ + /* if we made it up to here when op == SCAN_OP_OPEN_DEVICE, + * no devices to open had been found. */ if (op == SCAN_OP_OPEN_DEVICE) { error(ctx, "Cannot find any device to open\n"); ret = -ENODEV; @@ -1128,7 +1129,7 @@ AM7XXX_PUBLIC int am7xxx_get_device_info(am7xxx_device *dev, am7xxx_device_info *device_info) { int ret; - struct am7xxx_header h = { 0 }; + struct am7xxx_header h; if (dev->device_info) { memcpy(device_info, dev->device_info, sizeof(*device_info)); @@ -1139,6 +1140,7 @@ AM7XXX_PUBLIC int am7xxx_get_device_info(am7xxx_device *dev, if (ret < 0) return ret; + memset(&h, 0, sizeof(h)); ret = read_header(dev, &h); if (ret < 0) return ret;