aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/numeric.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/numeric.h b/src/util/numeric.h
index 74c1dfea6..a158a2eae 100644
--- a/src/util/numeric.h
+++ b/src/util/numeric.h
@@ -258,7 +258,7 @@ inline u32 get_bits(u32 x, u32 pos, u32 len)
inline void set_bits(u32 *x, u32 pos, u32 len, u32 val)
{
u32 mask = (1 << len) - 1;
- *x &= ~(mask << len);
+ *x &= ~(mask << pos);
*x |= (val & mask) << pos;
}