]> sigrok.org Git - libsigrok.git/commitdiff
scpi: don't stop parsing table at command 0 which is a valid command
authorAurelien Jacobs <redacted>
Sun, 20 Sep 2015 14:18:18 +0000 (16:18 +0200)
committerAurelien Jacobs <redacted>
Sun, 20 Sep 2015 14:18:18 +0000 (16:18 +0200)
command 0 is SCPI_CMD_REMOTE

src/scpi/helpers.c

index c686390ffb62c0f524f3783ffa7bac2a1405102d..4e4796fcf892f73abd18a0a063f4d7b50cefa38a 100644 (file)
@@ -55,7 +55,7 @@ SR_PRIV const char *scpi_cmd_get(const struct scpi_command *cmdtable, int comman
                return NULL;
 
        cmd = NULL;
-       for (i = 0; cmdtable[i].command; i++) {
+       for (i = 0; cmdtable[i].string; i++) {
                if (cmdtable[i].command == command) {
                        cmd = cmdtable[i].string;
                        break;