entry.c: fix possible buffer overflow in remove_subtree()