AMC-detect has an infinite loop on arm/arm64 (Bug #661)
As reported here: https://project.auto-multiple-choice.net/boards/4/topics/3212?r=8625 for arm and observed by myself for arm64, the AMC-detect program seems to take forever to run.
I investigated it on AMC 1.4.0 on Armbian bionic arm64 (Olimex image), recompiled it with -g flag and found with gdb that it was always running getopt.
The problem is the char c; declaration which is on line 1073 on master.
On arm and arm64, char is unsigned so when getopt returns -1, it is converted to 254 and then compares different to -1. As a consequence, the loop never ends.
I attach a patch making this modification on the code in master.
I tested this modification successfully on AMC 1.4.0 with Armbian bionic arm64.