]> sigrok.org Git - sigrok-cli.git/commitdiff
main: terminate with error when -B was specified but -P is missing
authorGerhard Sittig <redacted>
Wed, 4 Jul 2018 17:55:58 +0000 (19:55 +0200)
committerGerhard Sittig <redacted>
Mon, 3 Aug 2020 20:00:31 +0000 (22:00 +0200)
This fixes bug #1180.

main.c

diff --git a/main.c b/main.c
index 2c1dcfed1f901f78d0056bdb85ef06dbfdcf1407..02f69a2ebbb5d998bf609844b01c488a525c613b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -224,6 +224,11 @@ int main(int argc, char **argv)
                goto done;
 
 #ifdef HAVE_SRD
+       if (opt_pd_binary && !opt_pds) {
+               g_critical("Option -B will not take effect in the absence of -P.");
+               goto done;
+       }
+
        /* Set the loglevel (amount of messages to output) for libsigrokdecode. */
        if (srd_log_loglevel_set(opt_loglevel) != SRD_OK)
                goto done;