fixed buffer overflow in listInv();