ericpaulbishop/gargoyle — pull request #276 by chinawrj (2013-12-05 07:16:26+00:00)
Title: fix dead loop under arm CPU(char is unsigned under some arm gcc)

getopt returns signed int, and that int is converted to char. But under some arm compiler, the char is unsigned.
When char is signed:
getopt returns '-1', char 'c' gets '-1'. Because char 'c' is signed. so char 'c' is extended to int(still -1) to compare with '-1'.
When char is unsigned:
getopt returns '-1', char 'c' gets '0xffffffff", then '0xffffffff' is cut to '0xffff'. so char 'c' is '0xffff'. Then char 'c' is extended to int(0x0000ffff) to compare with '-1'(0xffffffff). But '0x0000ffff' is not equal to '0xffffffff'. Then dead loop appears.