You're seeing the difference between a signed char and an unsigned char (why does C say char can have a sign? who knows). Bitwise, they are the same value: http://en.wikipedia.org/wiki/Two%27s_complement
It's worth noting that man 3 getopt (first point of call) tells you that -1 is returned when there are no more options to pass and that getopt() returns an 'int', not a 'char'.
no subject
It's worth noting that man 3 getopt (first point of call) tells you that -1 is returned when there are no more options to pass and that getopt() returns an 'int', not a 'char'.