summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libcss/select.h2
-rw-r--r--src/select/select.c4
2 files changed, 2 insertions, 4 deletions
diff --git a/include/libcss/select.h b/include/libcss/select.h
index 76c226b..9e77d68 100644
--- a/include/libcss/select.h
+++ b/include/libcss/select.h
@@ -45,7 +45,7 @@ typedef struct css_select_results {
* then no computed style will be created and
* the corresponding pointer will be set to NULL
*/
- css_computed_style *styles[];
+ css_computed_style *styles[CSS_PSEUDO_ELEMENT_COUNT];
} css_select_results;
typedef struct css_select_handler {
diff --git a/src/select/select.c b/src/select/select.c
index 5c68699..df5795f 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -311,9 +311,7 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
state.pw = pw;
/* Allocate the result set */
- state.results = ctx->alloc(NULL, sizeof(css_select_results) +
- CSS_PSEUDO_ELEMENT_COUNT *
- sizeof(css_computed_style *), ctx->pw);
+ state.results = ctx->alloc(NULL, sizeof(css_select_results), ctx->pw);
if (state.results == NULL)
return CSS_NOMEM;