aboutsummaryrefslogtreecommitdiff
path: root/src/css.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/css.cc')
-rw-r--r--src/css.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/css.cc b/src/css.cc
index 2846fe5b..04bd8414 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -367,8 +367,9 @@ void CssStyleSheet::addRule (CssRule *rule) {
*/
void CssStyleSheet::apply (CssPropertyList *props,
Doctree *docTree, const DoctreeNode *node) {
- RuleList *ruleList[32];
- int numLists = 0, index[32] = {0};
+ static const int maxLists = 32;
+ RuleList *ruleList[maxLists];
+ int numLists = 0, index[maxLists] = {0};
if (node->id) {
lout::object::ConstString idString (node->id);
@@ -380,8 +381,8 @@ void CssStyleSheet::apply (CssPropertyList *props,
if (node->klass) {
for (int i = 0; i < node->klass->size (); i++) {
- if (i >= 16) {
- MSG_WARN("Maximum number of classes per node exceeded.\n");
+ if (i >= maxLists - 4) {
+ MSG_WARN("Maximum number of classes per element exceeded.\n");
break;
}