diff options
authorMarc Schink <jaylink-dev@marcschink.de>2016-12-11 15:14:10 +0100
committerMarc Schink <jaylink-dev@marcschink.de>2016-12-11 17:38:27 +0100
commitb5594fe118da23e2f075cf10d0f62078dbe3de28 (patch)
parent8f3e9d47fc4818a25ca95440e82a18a514447ee3 (diff)
Initialize variable to make scan-build happy
scan-build generates the following warning: ../../libjaylink/discovery.c:234:21: warning: Assigned value is garbage or undefined dev->serial_number = serial_number; The variable 'serial_number' is not initialized if the device has no valid serial number. This is not a real issue because the variable will never be accessed if the device has no valid serial number. Signed-off-by: Marc Schink <jaylink-dev@marcschink.de>
1 files changed, 1 insertions, 0 deletions
diff --git a/libjaylink/discovery.c b/libjaylink/discovery.c
index a389f26..81272af 100644
--- a/libjaylink/discovery.c
+++ b/libjaylink/discovery.c
@@ -192,6 +192,7 @@ static struct jaylink_device *probe_device(struct jaylink_context *ctx,
return NULL;
+ serial_number = 0;
valid_serial_number = true;
ret = libusb_get_string_descriptor_ascii(usb_devh, desc.iSerialNumber,