diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-06-07 22:44:49 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-06-07 22:44:49 +0200 |
commit | 586e6deefd4c8bcf7f904246a68063c1199865a1 (patch) | |
tree | 3daa9f8479a052211f4cba17d28182a7e648c385 /src/html.cc | |
parent | 09b83d718a1edaa10d6947dcba5e4093637a88b8 (diff) |
Ensure the same number of tags for CSS and HTML
The Tags array can be modified without changing the "ntags" number in
the CSS side. To prevent errors, an static assert ensures the same
number is used in both sides, which is known at compilation time.
Fixes: https://github.com/dillo-browser/dillo/issues/184
Diffstat (limited to 'src/html.cc')
-rw-r--r-- | src/html.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/html.cc b/src/html.cc index c0d4d388..323b7b1e 100644 --- a/src/html.cc +++ b/src/html.cc @@ -3555,6 +3555,8 @@ static const TagInfo Tags[] = { }; #define NTAGS (sizeof(Tags)/sizeof(Tags[0])) +static_assert(NTAGS == HTML_NTAGS, + "Mismatch between number of tags in Tags and HTML_NTAGS"); /* * Compares tag from buffer ('/' or '>' or space-ended string) [p1] |