error = FALSE;
range = NULL;
- probelist = g_malloc0(max_probes * sizeof(char *));
+ if (!(probelist = g_try_malloc0(max_probes * sizeof(char *)))) {
+ /* TODO: Handle errors. */
+ }
tokens = g_strsplit(probestring, ",", max_probes);
for (i = 0; tokens[i]; i++) {
devices = sr_device_list();
for (l = devices; l; l = l->next) {
d = l->data;
- if (strstr(d->plugin->name, "demo"))
+ if (sr_device_has_hwcap(d, SR_HWCAP_DEMO_DEVICE))
continue;
if (device_cnt == device_num) {
if (device_num == device_cnt) {
plugin = p->data;
if (strcmp(plugin->name, devicestring))
continue;
- num_devices = sr_init_hwplugins(plugin);
+ num_devices = sr_init_hwplugin(plugin);
if (num_devices == 1) {
devices = sr_device_list();
device = devices->data;