Pass unitsize to srd_session_send() directly.
[sigrok-cli.git] / parsers.c
index f0e2a7f8ebccb10073a44ecb8968e0a008336294..333e6e49053e24c0555e2443d75b9a748ca4b63d 100644 (file)
--- a/parsers.c
+++ b/parsers.c
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "sigrok-cli.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
 #include <glib.h>
-
-extern struct sr_context *sr_ctx;
+#include "sigrok-cli.h"
 
 struct sr_channel *find_channel(GSList *channellist, const char *channelname)
 {
@@ -410,12 +408,15 @@ int parse_driver(char *arg, struct sr_dev_driver **driver, GSList **drvopts)
        int i;
        char *drvname;
 
+       if (!arg)
+               return FALSE;
+
        drvargs = parse_generic_arg(arg, TRUE);
 
        drvname = g_strdup(g_hash_table_lookup(drvargs, "sigrok_key"));
        g_hash_table_remove(drvargs, "sigrok_key");
        *driver = NULL;
-       drivers = sr_driver_list();
+       drivers = sr_driver_list(sr_ctx);
        for (i = 0; drivers[i]; i++) {
                if (strcmp(drivers[i]->name, drvname))
                        continue;