Initialize the fingerprint before use.

The fingerprint is used unconditionally, regardless of whether it's
explicitly set by the application or not. Therefore it needs to be
initialized properly.
This commit is contained in:
Jef Driesen 2014-08-26 18:38:45 +02:00
parent 6845d9b77c
commit cde70334b0
4 changed files with 4 additions and 0 deletions

View File

@ -188,6 +188,7 @@ cressi_edy_device_open (dc_device_t **out, dc_context_t *context, const char *na
// Set the default values.
device->port = NULL;
device->model = 0;
memset (device->fingerprint, 0, sizeof (device->fingerprint));
// Open the device.
int rc = serial_open (&device->port, context, name);

View File

@ -89,6 +89,7 @@ cressi_leonardo_device_open (dc_device_t **out, dc_context_t *context, const cha
// Set the default values.
device->port = NULL;
memset (device->fingerprint, 0, sizeof (device->fingerprint));
// Open the device.
int rc = serial_open (&device->port, context, name);

View File

@ -164,6 +164,7 @@ diverite_nitekq_device_open (dc_device_t **out, dc_context_t *context, const cha
// Set the default values.
device->port = NULL;
memset (device->fingerprint, 0, sizeof (device->fingerprint));
// Open the device.
int rc = serial_open (&device->port, context, name);

View File

@ -152,6 +152,7 @@ zeagle_n2ition3_device_open (dc_device_t **out, dc_context_t *context, const cha
// Set the default values.
device->port = NULL;
memset (device->fingerprint, 0, sizeof (device->fingerprint));
// Open the device.
int rc = serial_open (&device->port, context, name);