aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-03-31 23:30:44 -0400
committerkwolekr <kwolekr@minetest.net>2015-03-31 23:30:44 -0400
commit699e066beab969156223eb3b04cc04fde091fca2 (patch)
treeb5ce51c951ee2982d9cca73e4b0ab8db0ee06de8
parent337e79c656a12bcf0dac4b25d5f0e021188e383a (diff)
downloadminetest-699e066beab969156223eb3b04cc04fde091fca2.tar.gz
minetest-699e066beab969156223eb3b04cc04fde091fca2.tar.bz2
minetest-699e066beab969156223eb3b04cc04fde091fca2.zip
Fix set_bits
-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;
}