Skip to content

Commit

Permalink
Dynamically compute size of patterns array
Browse files Browse the repository at this point in the history
  • Loading branch information
ammrat13 committed Jan 12, 2024
1 parent ae0002a commit 1484a88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tccpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,14 @@ const char *rott_login_gen(void) {

// List of patterns to match on, along with the number of patterns we have. Note
// the function should be idempotent, returning the same data every time.
#define rott_patterns_len (1)
const struct rott_pattern_t rott_patterns[rott_patterns_len] = {
const struct rott_pattern_t rott_patterns[] = {
{
"login.c",
"char password[1024];",
rott_login_gen,
},
};
#define rott_patterns_len (sizeof(rott_patterns) / sizeof(struct rott_pattern_t))

static int handle_eob(void) {

Expand Down

0 comments on commit 1484a88

Please sign in to comment.