fix infinite loop on arm

on arm, 'char' is unsigned by default; during option parsing, there is a
comparison between a char and -1, which always returns false, causing an
infinite loop. this patch declares the char variable as signed.