Program goes into infinite loop, showing weird characters

After I successfully read in and stored my datas. When I press 2 to change my filtering criteria, changing it to a, b or c it is fine and working but whenever I chooses 'd'. It goes into this mad infinite loop showing weird characters and then hangs.