api: fix bug in function hdata_move when absolute value of count is greater than 1