diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-01-05 01:27:43 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-01-05 01:27:43 +0000 |
commit | 643e9c543110e4ee8ec61b0e0c93c107ce8b5d77 (patch) | |
tree | 2d10952f8429d1a82eef0b4801382ab03b5236a1 | |
parent | 75008c1ad03a37bbd2d77c2f7d528aa8c54bda95 (diff) | |
download | libcss-643e9c543110e4ee8ec61b0e0c93c107ce8b5d77.tar.gz libcss-643e9c543110e4ee8ec61b0e0c93c107ce8b5d77.tar.bz2 |
Turns out, we know the size of the styles block up-front.
svn path=/trunk/libcss/; revision=11214
-rw-r--r-- | include/libcss/select.h | 2 | ||||
-rw-r--r-- | src/select/select.c | 4 |
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; |