aboutsummaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2023-05-06 13:43:32 -0400
committerBruce Hill <bruce@bruce-hill.com>2023-05-06 13:43:32 -0400
commit6f5bb02b923c1402eba04ce78033317da401971e (patch)
tree7b43203ca28667b8d3526445b1ee2aff8bf43495 /json.c
parent0050a6fc064f7700d9940bf4fd381c7a072652a6 (diff)
Use tagged union style for extra safety and concision
Diffstat (limited to 'json.c')
-rw-r--r--json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/json.c b/json.c
index 17533ca..71ada3b 100644
--- a/json.c
+++ b/json.c
@@ -28,7 +28,7 @@ static int _json_match(const char *text, match_t *m, int comma, bool verbose)
comma = 0;
printf("{");
if (m->pat->type == BP_TAGGED) {
- printf("\"tag\":\"%.*s\"", (int)m->pat->args.capture.namelen, m->pat->args.capture.name);
+ printf("\"tag\":\"%.*s\"", (int)Match(m->pat, BP_TAGGED)->namelen, Match(m->pat, BP_TAGGED)->name);
comma = 1;
}
if (verbose) {