The strangest thing is happening with this program: It crashes whenever it is given a '*' as a command line argument. If we modify it to use 'x' instead for multiplication, there are no problems. WHAT IS GOING ON HERE!
My guess is this: you are running the code from a Windows command shell (the "command line" window). When Windows sees the * character at the command line it interprets that as a request for a list of all files in the directory, and passes that list to the application. That would not be anything like what your code was expecting.
If you insert some debugging code you should be able to confirm (or not) that guess.