]> sigrok.org Git - sigrok-cli.git/blobdiff - session.c
decode: improve readability, use intermediate variables
[sigrok-cli.git] / session.c
index 4a3878a57507c1c81c6202f99e39907172b17fb5..152f9790b818bcffc94a1e81b1796852abbe8ce4 100644 (file)
--- a/session.c
+++ b/session.c
@@ -577,6 +577,12 @@ void run_session(void)
                }
        }
 
+       /* This is unlikely to happen but it makes static analyzers stop complaining. */
+       if (!devices) {
+               g_critical("No real devices found.");
+               return;
+       }
+
        sdi = devices->data;
        g_slist_free(devices);
        g_slist_free(real_devices);
@@ -669,7 +675,7 @@ void run_session(void)
 
        if (opt_frames) {
                if ((sr_parse_sizestring(opt_frames, &limit_frames) != SR_OK)) {
-                       g_critical("Invalid sample limit '%s'.", opt_samples);
+                       g_critical("Invalid frame limit '%s'.", opt_frames);
                        sr_session_destroy(session);
                        return;
                }