fix getopt return value type

getopt returns an int, not a char (and ARM chars are unsigned by default).