mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
bug fix - 42cf5f8214
This commit is contained in:
parent
2f5de9ed0a
commit
2592aeb85e
1 changed files with 3 additions and 1 deletions
|
@ -128,7 +128,9 @@ static int b_rot(lua_State *L, int i) {
|
||||||
b_uint r = luaL_checkunsigned(L, 1);
|
b_uint r = luaL_checkunsigned(L, 1);
|
||||||
i &= (LUA_NBITS - 1); /* i = i % NBITS */
|
i &= (LUA_NBITS - 1); /* i = i % NBITS */
|
||||||
r = trim(r);
|
r = trim(r);
|
||||||
r = (r << i) | (r >> (LUA_NBITS - i));
|
if (i != 0) /* avoid undefined shift of LUA_NBITS when i == 0 */
|
||||||
|
r = (r << i) | (r >> (LUA_NBITS - i));
|
||||||
|
|
||||||
lua_pushunsigned(L, trim(r));
|
lua_pushunsigned(L, trim(r));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue