summaryrefslogtreecommitdiff
path: root/src/utils/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/utils.h')
-rw-r--r--src/utils/utils.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utils/utils.h b/src/utils/utils.h
index f1ab6d7..333a33f 100644
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -106,9 +106,10 @@ static inline fixed number_from_css_string(const css_string *string,
len--;
}
fracpart = ((1 << 10) * fracpart + pwr/2) / pwr;
- /* Extra paranoid clamp to maximum fractional part */
- if (fracpart >= (1 << 10))
- fracpart = (1 << 10) - 1;
+ if (fracpart >= (1 << 10)) {
+ intpart++;
+ fracpart &= (1 << 10) - 1;
+ }
}
/* If the intpart is larger than we can represent,