Use getopt's api as intended, store the return value in an int, not char

getopt returns an integer which is -1 when there is no more options left to be parsed.
Currently this result is stored in a char, which by definition is undefined whether
it is signed or unsigned. On ARM it may be unsigned and thus -1 never happens.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>