Explicitly assign NULL to param to avoid the "may be used uninitialized"
warning reported in bug #1094. Behaviour remains unchanged. All references
to the variable were under "if (!conn)", and the assigning arm of the
branch checked for "if (!param)" after assignment. So the error could
not happen, but compilers may not have noticed depending on the width of
their scope during compilation.
Move the initialization of 'conn' closer to the conditional assignment,
such that all paths are seen in one spot during maintenance.
This fixes bug #1094.
struct sr_config *src;
struct sr_dev_inst *sdi;
struct dev_context *devc;
- const char *conn = NULL;
+ const char *conn;
gchar **params;
int i, maxch;
maxch = NUM_CHANNELS;
+ conn = NULL;
for (l = options; l; l = l->next) {
src = l->data;
if (src->key == SR_CONF_NUM_LOGIC_CHANNELS)
/* Probe for /dev/beaglelogic if not connecting via TCP */
if (!conn) {
+ params = NULL;
if (!g_file_test(BEAGLELOGIC_DEV_NODE, G_FILE_TEST_EXISTS))
return NULL;
} else {