X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fvictor-dmm%2Fapi.c;h=d415a3f9cc86c4809db8dd44898a1c222dec3d19;hb=823b0e29ae8e61c98ed9cd096c9d42a008659a7d;hp=d03c63980b9a5ba95cb661704fde199ad06e1a00;hpb=dd7a72ea697a172032f5473b0ddff5e8d47222f4;p=libsigrok.git diff --git a/src/hardware/victor-dmm/api.c b/src/hardware/victor-dmm/api.c index d03c6398..d415a3f9 100644 --- a/src/hardware/victor-dmm/api.c +++ b/src/hardware/victor-dmm/api.c @@ -69,7 +69,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) if (des.idVendor != VICTOR_VID || des.idProduct != VICTOR_PID) continue; - usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); + if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0) + continue; sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INACTIVE; @@ -142,7 +143,6 @@ static int config_get(uint32_t key, GVariant **data, { struct dev_context *devc = sdi->priv; struct sr_usb_dev_inst *usb; - char str[128]; (void)cg; @@ -151,8 +151,7 @@ static int config_get(uint32_t key, GVariant **data, if (!sdi || !sdi->conn) return SR_ERR_ARG; usb = sdi->conn; - snprintf(str, 128, "%d.%d", usb->bus, usb->address); - *data = g_variant_new_string(str); + *data = g_variant_new_printf("%d.%d", usb->bus, usb->address); break; case SR_CONF_LIMIT_SAMPLES: case SR_CONF_LIMIT_MSEC: