X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Finput%2Fvcd.c;fp=src%2Finput%2Fvcd.c;h=a9d3c45c1b91c2ba907336f7dea8452290dbe731;hp=47511c416ee90be723e6a20bcde6660ac37dd01b;hb=34724ffa340b4df9706aa02d686563ed72b7840f;hpb=36dacf17bc5fe333c6557d073011e2033b6f544f diff --git a/src/input/vcd.c b/src/input/vcd.c index 47511c41..a9d3c45c 100644 --- a/src/input/vcd.c +++ b/src/input/vcd.c @@ -428,14 +428,28 @@ static void parse_contents(const struct sr_input *in, char *data) inc->skip_until_end = TRUE; break; } - } else if (strchr("bBrR", tokens[i][0]) != NULL) { - sr_dbg("Vector values not supported yet"); + } else if (strchr("rR", tokens[i][0]) != NULL) { + sr_dbg("Real type vector values not supported yet!"); if (!tokens[++i]) /* No tokens left, bail out */ break; else /* Process next token */ continue; + } else if (strchr("bB", tokens[i][0]) != NULL) { + bit = (tokens[i][1] == '1'); + + /* + * Bail out if a) char after 'b' is NUL, or b) there is + * a second character after 'b', or c) there is no + * identifier. + */ + if (!tokens[i][1] || tokens[i][2] || !tokens[++i]) { + sr_dbg("Unexpected vector format!"); + break; + } + + process_bit(inc, tokens[i], bit); } else if (strchr("01xXzZ", tokens[i][0]) != NULL) { char *identifier;